Help Needed image file Problem
Posted: Wed Feb 06, 2008 4:15 am
Hello can anyone help me I have been trying for days to basically check to see if an image file exists on a remote server and if it does not to show a default image but no matter what i try ie file_exists, fopen and so on none of them can return the correct value of yes or no. No one has been able to help me with this so if anyone has any ideas please let me know i have posted a little bit of code to show you where its need hopefully it will help
Code: Select all
<?PHP
$exists = false;
$url = "http://naturanauk.co.uk/photos/".str_replace("/","",htmlspecialchars($row["PROD/COL"])).".jpg";
if($exists){
?>
<td class="<?php echo $style; ?>"><a href="<?php echo "http://naturanauk.co.uk/photos/".str_replace("/","",htmlspecialchars($row["PROD/COL"])).".jpg"; ?>"><img src="<?php echo "http://naturanauk.co.uk/photos/".str_replace("/","",htmlspecialchars($row["PROD/COL"])).".jpg"; ?>" height="50" width="50" border=0></a></td>
<?PHP
}
else {
?>
<td class="<?php echo $style ?>"><img src="<?php echo "http://naturanauk.co.uk/photos/noimage.jpg"; ?>" height="50" width="50" border=0></td>
<?PHP
}
?>