topical media & game development
basic-php-09-snippet06.php / php
<?php
//create your error handler function
function handler(error_message,
error_line) {
switch(to = "Administrator <admin@yourdomain.com>";
body = "<html>";
body .= "<title>Website error</title>";
body .= "<body>";
body .= "Error received was a <b>" . body .= "The page that generated the error was: <b>" .
body .= " and was generated on line: <b>" . body .= "The generated error message was:" . body .= "</body>";
headers = "MIME-Version: 1.0\r\n";
headers .= "From: Apache Error <host@yourdomain.com>\r\n";
to, body, to = "Administrator <admin@yourdomain.com>";
body = "<html>";
body .= "<title></title>";
body .= "<body>";
body .= "Error received was a <b>" . body .= "The page that generated the error was: <b>" .
body .= " and was generated on line: <b>" . body .= "The generated error message was:" . body .= "</body>";
headers = "MIME-Version: 1.0\r\n";
headers .= "From: Apache Error <host@yourdomain.com>\r\n";
to, body,
(C) Æliens
20/2/2008
You may not copy or print any of this material without explicit permission of the author or the publisher.
In case of other copyright issues, contact the author.