example of file_exists() ???

From: Date: Mon, 30 Oct 2000 08:09:23 +0000
Subject: example of file_exists() ???
Groups: php.general 
Request: Send a blank email to php-general+get-22624@lists.php.net to get a copy of this message
Hello All, Can someone kindly post an example of using file_exists() ??? I've checked the manual, read some manual notes, tried out a few variations but nada .... This is the offensive code: if (file_exists("common.php")) { require("common.php"); $hostname = DBSERVERHOST; //bring in the rest of the CONSTANTS, do an autologin // more snipped code }else{ // do a manual login instead without common.php } ... and so on ... This is the error it gives: Warning: Unable to access common.php Fatal error: Failed opening required 'common.php' Of course it can't access common.php, it isn't there - that is what I want to test for - the absence of that common.php file! It would be nice if there was just ONE working example included in with the manual for each function... the manual looks clear and concise, but my code doesn't work :( Thank you. Regards, Richard Creech richardc@dreamriver.com Phone: 250.744.3350 Pacific Time Canada Get a free link at http://www.dreamriver.com/phpYellow/ Download phpYellow Pages 2000 - Now shipping Version 1.05 with EasySQL! Add Dynamic Database Content to your Website http://dreamriver.com/software/

« previous php.general (#22624) next »