How to know a code in php run sucessfully or not -


i have fallowing code

<html> <body> <?php if ($_get['run']) {   # code run if ?run=true set.  echo "hello";   exec ("chmod a+x ps.sh");    exec ("sh ps.sh"); } ?>  <!-- link add ?run=true url, myfilename.php?run=true --> <a href="?run=true">click me!</a> 

now want know exec ("chmod a+x ps.sh") executing or not. should do??

exec(..., $output, $return);  if ($return != 0) {     // went wrong } 

capture return code supplying variable name third parameter. if variable contains 0 afterwards, good. if it's other 0, went wrong.


Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -