RE: [PHP] file_exists() not working correctly?

From: Date: Mon, 25 Aug 2008 08:32:33 +0000
Subject: RE: [PHP] file_exists() not working correctly?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-278639@lists.php.net to get a copy of this message
-:- -----Original Message----- -:- From: Chris [mailto:dmagick@gmail.com] -:- Sent: Monday, August 25, 2008 9:49 AM -:- To: Chris Haensel -:- Cc: php-general@lists.php.net -:- Subject: Re: [PHP] file_exists() not working correctly? -:- -:- -:- > That worked like a charm. Now, can you tell me why that -:- exact same function -:- > works with a relative path on another server and with a -:- "full path only" on -:- > this server? I am glad that it works, but would also -:- like to understand why -:- > :o) -:- -:- Could be different document roots for apache, different -:- environment -:- settings, lots of things. -:- -:- If you have a config variable for the base folder of your -:- app, try to -:- use that. -:- -:- If you don't, then work out the path relative to the file -:- this function -:- is in. -:- -:- $mydir = dirname(__FILE__); -:- $path_to_folder = $mydir . '/../../images/....'; -:- -:- That way it's relative to the file the function is in and -:- you don't have -:- to change it each time you put it on a new server. -:- -:- -- -:- Postgresql & php tutorials -:- http://www.designmagick.com/ -:- -:- Thanks mate! Appreciate your help!! Have a great day all! Chris

« previous php.general (#278639) next »