note 35439 added to function.file-exists

From: Date: Mon, 01 Sep 2003 12:24:11 +0000
Subject: note 35439 added to function.file-exists
Groups: php.notes 
Request: Send a blank email to php-notes+get-55400@lists.php.net to get a copy of this message
$page = $_GET['page']; if (file_exists("inc/" . $page . ".inc")) { include("inc/" . $page . ".inc"); } else { echo "Sorry, that file does not exist..."; } this means that if a users types test.php?page=hello, it will check to see if the file inc/hello.inc exists, if this does does exist, include, if not, say that the filename doesnt exist. ---- Manual Page -- http://www.php.net/manual/en/function.file-exists.php Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+35439 Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+35439&report=yes Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+35439&report=yes

« previous php.notes (#55400) next »