Reply to Re: file_exists does not work

Your name:

Reply:


Posted by Krustov on 08/13/07 13:34

<comp.lang.php>
<Bob Sanderson>
<Mon, 13 Aug 2007 12:36:19 GMT>
<Xns998B5789B4327centroidincearthlink@69.28.186.158>

> This is my code:
>
> if (file_exists($Fname)) {
> echo "<td>$Fname exists</td>";
> } else {
> echo "<td>$Fname does not exist</td>";
> }
>
> $Fname is the full path to the file I'm trying to verify. When I run the
> script, I get the following output:
>
> http://server1:8080/images/dwg_images/5005/5005001_.pdf does not exist
>
> If I cut-and-paste the output path, the file is displayed, confirming that
> the file does exist.
>

As another user its best if you check the actual folder path rather than
a http url .

You can also write it like the below if you dont want to use else .


$pass=1;

$tempname="images/5005/5005001.pdf";

if (!file_exists($tempname)) {$pass=0;}

if ($pass==0) {print "<td>$tempname FILE NOT FOUND</td>";}

if ($pass==1) {print "<td>$tempname OK</td>";}

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация