note 26019 deleted from function.set-error-handler by maxim
| From: | maxim@php.net | Date: | Tue, 15 Oct 2002 13:00:14 +0000 |
| Subject: | note 26019 deleted from function.set-error-handler by maxim | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-38109@lists.php.net to get a copy of this message | ||
A dirty but fully working way of capturing EVERY ERROR(even fatal, parse etc.) in PHP is the
following little code-snippet:
Use this in a separate file eg. error_handler.php
ini_set('error_prepend_string', '<body onload="r.submit()"><form
action="error.php" name="r"><textarea name="e"
STYLE="visibility: hidden">');
ini_set('error_append_string', '</textarea></form></body>');
Then create a page called error.php and the error message is sent in the variable "e". I
that page you can show a friendly error-message, write to any log, send a mail or whatever you like.
This works perfectly for me, and should work for any user that has a browser accepting javascript.