Hi,
I'm trying to use the file_exists() function to load an image but get repeated errors. Code is as follows:
// Foto //
if (file_exists("/production/img/retratos/".$row['ID'].".jpg") { ?>
<img src='/production/img/retratos/<?PHP echo $row['ID'] ?>.jpg"' width='80' height='80' border='0'>
<? } else { ?>
<img src='/production/img/retratos/nophoto.jpg' width='80' height='80' border='0'>
<? }
The result of the above code is to set ALL images as non-existent and to load the no photo image (even though the photos do exist). It's not Db related as the standard images call here:
echo ("<img src='/production/img/retratos/".$row['ID'].".jpg' width='80' height='80' border='0'>\n"
... works just fine.
What am I missing? Surely the file does not have to be in the same dir?
Thanks for any advice / comments.
Gary
I'm trying to use the file_exists() function to load an image but get repeated errors. Code is as follows:
// Foto //
if (file_exists("/production/img/retratos/".$row['ID'].".jpg") { ?>
<img src='/production/img/retratos/<?PHP echo $row['ID'] ?>.jpg"' width='80' height='80' border='0'>
<? } else { ?>
<img src='/production/img/retratos/nophoto.jpg' width='80' height='80' border='0'>
<? }
The result of the above code is to set ALL images as non-existent and to load the no photo image (even though the photos do exist). It's not Db related as the standard images call here:
echo ("<img src='/production/img/retratos/".$row['ID'].".jpg' width='80' height='80' border='0'>\n"
... works just fine.
What am I missing? Surely the file does not have to be in the same dir?
Thanks for any advice / comments.
Gary