> 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
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php