Re: HTML if no PHP
| From: | Philip Olson | Date: | Tue, 04 Feb 2003 17:42:37 +0000 |
| Subject: | Re: HTML if no PHP | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-134302@lists.php.net to get a copy of this message | ||
> I want to display an HTML page if PHP can't load an include
> file or otherwise has an error or just doesn't work.
> How do I do this?
include returns false on failure and here's a hack to
demonstrate. Once you implement your own error
handling, be sure to set error_reporting accordingly
or supress with @.
if (!include('foo.php')) {
if (!include('static.html')) {
print 'ut oh, this is serious.';
}
}
Be sure to read about PHP's error handling capabilities to
do something more useful and/or create your own error
handling functions/system.
See also: http://www.php.net/trigger_error
http://www.php.net/set_error_handler
http://www.php.net/ref.errorfunc
Regards,
Philip