Re: Handling Errors Gracefully
| From: | Ernest E Vogelsinger | Date: | Sat, 09 Nov 2002 23:05:10 +0000 |
| Subject: | Re: Handling Errors Gracefully | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-123633@lists.php.net to get a copy of this message | ||
Ok, it's late, and my last post for today, but I need to get this right ;-)
<?php
if ($we_found_an_error) {
$url = 'http://' . $_SERVER['SERVER_NAME'] .
'/my_error_handler.php?any_parameters_you_need';
echo '<script language="JavaScript">',
'document.location.href="', $url, '">',
'</script>',
'<hr>',
'A nasty error has occurred. If you are not redirected ',
'to the correct page, <a href="',$url,'">click
here</a> to',
'continue (sorry folks)',
'</script></body></html>';
exit;
}
// else no error - continue
?>
--
>O Ernest E. Vogelsinger
(\) ICQ #13394035
^ http://www.vogelsinger.at/