|
Posted by on 02/13/06 04:44
Found the example in the magazine:
---
<?php error_reporting (E_ERROR | E_WARNING | E_NOTICE);
$reportMail = 'you@youremail.com';
$redirectPage = 'http://www.yourdomain.com/error.htm'
function pageError($errno, $errstr, $errfile='?', $errline= '?') {
global $reportMail, $redirectPage;
if (($errno & error_reporting()) == 0)
return;
$err = ' ';
switch($errno) {
case E_ERROR: $err = 'FATAL'; break;
case E_WARNING: $err = 'ERROR'; break;
case E_NOTICE: return;
}
mail($reportMail, "PHP Error: $errfile' $errline",
"$errfile, Line $errline\n$err($errno)\n$errstr");
print '<META HTTP-EQUIV="Refresh" CONTENT="0;url=' .$redirectPage.
'">';
die();
}
set_error_handler('pageError');
?>
---
Then has a further little bit of info:
---
<?php
require('errorphp.php');
print 2/0;
?>
---
Does this example mean I can use my own custom error pages e.g. 404?
As I only had a short time, I didn't get the jist of the whole article
and so am asking for help.
Thanks
Navigation:
[Reply to this message]
|