hi
i am trying to execute a php code
eg
$code="<?php echo "hii"; ?>
echo exec("php $code");
the above works fine when there are no errors but incase of errors it does not give error msgs
after modifying
eg
$code="<?php echo "hi ?>
exec("php $code error.php 2>&1",$output,$return);
In the above example, error.php contains the errors even wen the php script in the $code variable is correct…
Whats i need
- Should display the output [Only when complete php script as in case of web browsers]
- When there is no output, it should display the error msgs
- If possible replace $code with a file [currently not working ]
Thanks
Aamir