RE: [PHP] HTML if no PHP
| From: | Jon Haworth | Date: | Tue, 04 Feb 2003 17:26:06 +0000 |
| Subject: | RE: [PHP] HTML if no PHP | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-134295@lists.php.net to get a copy of this message | ||
Hi Bob,
> 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?
Not sure you can, especially not for the "just doesn't work" scenario.
FWIW, you can test for the existence of a file before including it:
if (file_exists("file/to/be/included")) {
include ("file/to/be/included");
} else {
include ("backup/plain/HTML/file");
}
but that doesn't cover all the bases you asked about. I'd certainly be
interested to hear any solutions to this one :-)
Cheers
Jon