Log in

View Full Version : How can I see the error message when page is loaded?



tuffy
09-20-2011, 09:01 PM
Hello,
In my code, I create a php file by using the contents of a textarea that is used for trying PHP code.
If the php file has no syntax errors, it is loaded in the bwowser very well. But if it has syntax error(s) in it (i.e. writing ech instead of echo), I see a white page. But, instead of a white page I want the user to see the related error message (in this case "Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in C:\xampp\htdocs\tez\test.php on line 4").
If anyone can help me to solve this problem, I will be very happy.
Thank you.

Butterfly
09-21-2011, 06:08 PM
I assume you added error_reporting(E_ALL) to your primary PHP file, so I'd say you should include the textfile as PHP. It should be able to echo your errors.

Hopefully it'll work for you.