note 77929 added to function.require
| From: | scott at osu1 dot php dot net | Date: | Thu, 20 Sep 2007 08:27:45 +0000 |
| Subject: | note 77929 added to function.require | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-130623@lists.php.net to get a copy of this message | ||
If you want to verify that a file can be included or required, the simplest solution I've found
is just to check that the file exists.
<?php
if(file_exists($pageContentInc)){
require_once $pageContentInc;
}else{
$pageContentInc = "common/content_404.inc";
require_once $pageContentInc;
}
?>
Does it really need to be any harder than that?
----
Server IP: 209.41.74.194
Probable Submitter: 70.178.66.212
----
Manual Page -- http://www.php.net/manual/en/function.require.php
Edit -- https://master.php.net/note/edit/77929
Del: integrated -- https://master.php.net/note/delete/77929/integrated
Del: useless -- https://master.php.net/note/delete/77929/useless
Del: bad code -- https://master.php.net/note/delete/77929/bad+code
Del: spam -- https://master.php.net/note/delete/77929/spam
Del: non-english -- https://master.php.net/note/delete/77929/non-english
Del: in docs -- https://master.php.net/note/delete/77929/in+docs
Del: other reasons-- https://master.php.net/note/delete/77929
Reject -- https://master.php.net/note/reject/77929
Search -- https://master.php.net/manage/user-notes.php