note 35439 deleted from function.file-exists by vincent

From: Date: Mon, 01 Sep 2003 14:24:00 +0000
Subject: note 35439 deleted from function.file-exists by vincent
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-55414@lists.php.net to get a copy of this message
Note Submitter: admin at digitalmagik dot net ---- $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.

« previous php.notes (#55414) next »