RE: file_exists() not working correctly?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




-:-  -----Original Message-----
-:-  From: Chris [mailto:dmagick@xxxxxxxxx]
-:-  Sent: Monday, August 25, 2008 9:25 AM
-:-  To: Chris Haensel
-:-  Cc: php-general@xxxxxxxxxxxxx
-:-  Subject: Re:  file_exists() not working correctly?
-:-
-:-  Chris Haensel wrote:
-:-  > Good morning list,
-:-  >
-:-  > I have a _very_ simple function... it is as follows
-:-  >
-:-  > /**********************************************/
-:-  >
-:-  > function getgalimage($fzg) {
-:-  > 	$folder		=	"bilder";
-:-  > 	$imgname	=	$fzg."_1.JPG";
-:-  > 	$checkimg	=	$folder."/".$imgname;
-:-  > 	if(file_exists($checkimg)) {
-:-  > 		//echo '<img
-:-  > src="mod_search_thumbs.php?bild='.$imgname.'&fzg_nr='.$fzg.'">';
-:-  > 		echo '<img src="'.$checkimg.'">';
-:-  > 	} else {
-:-  > 		echo '<div style="display:block; padding:2px; border:1px
-:-  > solid red;"><a href="'.$checkimg.'">'.$checkimg.'</a></div>';
-:-  > 	}
-:-  > }
-:-  >
-:-  > /**********************************************/
-:-  >
-:-  > Now, the folder "bilder" exists, and I pass the number
-:-  0002822 to the
-:-  > function. Now it should check whether the image file
-:-  "bilder/0002822_1.JPG"
-:-  > exists. It never finds the image, even though it exists
-:-  (I checked it many
-:-  > times now)
-:-
-:-  Try a full path:
-:-
-:-  $folder = '/full/path/to/bilder';
-:-
-:-  --
-:-  Postgresql & php tutorials
-:-  http://www.designmagick.com/
-:-
-:-
-:-  --
-:-  PHP General Mailing List (http://www.php.net/)
-:-  To unsubscribe, visit: http://www.php.net/unsub.php
-:-
-:-

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)

Thanks for your help matey!

Chris



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux