RE: [PHP] HTML if no PHP
| From: | John W. Holmes | Date: | Wed, 05 Feb 2003 01:00:49 +0000 |
| Subject: | RE: [PHP] HTML if no PHP | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-134356@lists.php.net to get a copy of this message | ||
> 3) Include and execute capturing critical errors:
>
> $hf = fopen($incfile, 'r');
> if ($hf) {
> $buffer = fread($hf, filesize($incfile));
> fclose($hf);
> }
> if ($buffer) {
> global $php_errormsg;
> $php_errormsg = null;
> @eval($buffer);
> $err = $php_errormsg;
> }
>
> The rest goes as above. The "eval" statement will gracefully handle
any
> critical error that would bring your script to an immediate halt in
case
> of
> @include.
How about just using set_error_handler() and process the errors from
there?
---John W. Holmes...
PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/