Re: file_exists
| From: | Ronald Wiplinger | Date: | Wed, 14 Nov 2007 19:44:04 +0000 |
| Subject: | Re: file_exists | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-264516@lists.php.net to get a copy of this message | ||
Chris wrote:
> Ronald Wiplinger wrote:
>> I am having troubles with the function file_exists()
>>
>> I tried the full path like:
>>
>> if (file_exists('/srv/www/....../images/pic412.jpg') {
>> echo "<IMG SRC='images/pic412.jpg'>";
>> } else {
>> echo " " // picture is missing!
>> }
>>
>> No matter if I use the full path or just images/pic412.jpg, it always
>> shows the picture is missing!
>
Sorry, I expressed it wrong.
The picture is displayed if it exists!
However, when the picture does not exist, then the missing file is not
recognized (hence the subject line "file_exists")
With my if construction I try, if the picture does not exist, just to
echo " "
( is necessary for the table in which the picture would be displayed)
bye
Ronald