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

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -