My solution to the problem was to create an error reporting function. If something goes wrong during key parts of the code (eg database erorr, mail sending error, file reading error etc) then the error function is called. My error reporting function attempts to send me an email, and if the email is not sent instructs the user to send it manually. It also displays the normal site interface without any php features (its hard coded in HTML - that way I know it will ALWAYS work).
for example MySQL_query( "Do Stuff to MySQL" ) OR error_report( '1', 'A MySQL Error occured while doing XYZ', __FILE__, __LINE__, MySQL_error() ); I suggest you come up with a similar solution. Stephen ----- Original Message ----- From: "Matt Babineau" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, April 03, 2003 4:48 PM Subject: [PHP-WIN] Better Error Trapping! Hi All- I have searched for a while and cannot seem to find a quality error trapping script!!! Here is the situation, about a week ago one of the sites I built (which is hosted on a shared server @ an ISP) went down. It went down because the database server got moved. If I had been notified of the page errors that were being generated, I would have been able to address the problem more quickly and get their site back online. Luckily I found the problem, not the client, however they did have a few people call and ask about it. I was very angry and spent the rest of the day looking for a good error trapping script, but I couldn't find anything. I am not very experienced with error trapping in PHP, so here are a couple questions. Aside from major code errors which should be fixed in development, things like database connections won't stop the page from processing, so I am wondering if PHP Errors (Warnings?) are stored in an array? Maybe I can put a script into the php.ini appending every page with a small piece of code that checks if any errors are present and if they are immediately email me. Does that sound like a solid process for doing some basic alerting when PHP scripts are generating errors? I'd love to hear other people's input on this and how they are attacking this problem! Thanks! ------------------------------- Matt Babineau criticalcode e:: <mailto:[EMAIL PROTECTED]> [EMAIL PROTECTED] p:: 603.943.4237 w:: www.criticalcode.com -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php