Why does this PHP script show errors, but not echo etc.?

I have this PHP script http://snippi.com/s/kx0k48g (too long for here, but put it in Snippi). It is built to run by an AJAX GET request. When I supply all the right GET parameters the script seems to run fine (no errors), but it won’t echo or anthing else that the script does (inserting …

via PHP Website Development » Search Results » ajax:

Why does this PHP script show errors, but not echo etc.?

I have this PHP script http://snippi.com/s/kx0k48g (too long for here, but put it in Snippi). It is built to run by an AJAX GET request. When I supply all the right GET parameters the script seems to run fine (no errors), but it won’t echo or anthing else that the script does (inserting in the Database). It only shows something (errors) when I do not supply the right GET parameters. Any idea what could be wrong? It is extremely hard to debug, because it won’t tell me that anything is wrong, but refuses to do the right thing.
Any help would be appreciated. Thanks!
………………………………………….

Try using trigger_error() in PHP for debugging instead of echo. Then you don’t have to worry about output buffering, etc.
trigger_error(“I have reached checkpoint 1!”, E_USER_WARNING);Put a tail -f on your error log for your web server and see how far you get.
http://php.net/manual/en/function.trigger-error.php

For more info: Why does this PHP script show errors, but not echo etc.?

PHP Website Development » Search Results » ajax

Why does this PHP script show errors, but not echo etc.?

Share this post:

Related Posts

Leave a Comment