note 9218 added to include
| From: | sysopopfor at usa dot net | Date: | Mon, 23 Oct 2000 17:12:42 +0000 |
| Subject: | note 9218 added to include | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-6937@lists.php.net to get a copy of this message | ||
I found a way to check for an include and include it if it exists, or show a missing page or error
message. The only drawback is if there are errors in the included file, $success returns false.
Use @ to suppress the error, and control it yourself.
$success = @include($yourinclude);
if (!$success) { print "Can't find page $yourinclude"; }
http://www.php.net/manual/function.include.php