
06-06-2005, 08:32 AM
|
 |
SEO Junior and a half
|
|
Join Date: Jul 2004
Posts: 93
|
|
after learning php, I used the following code to load a seoncdary image if the first one fails to load, or does not exist.
PHP Code:
$img = "../pics/thumbs/{$row['part_numbers']}.jpg";
$image_width = getimagesize($img);
if(!getimagesize($img)) // if image does not exist, replace with secondary
{
echo "<td width=\"15%\"><img src=\"slotcars/logos/fly_logo.jpg\"></img>";
}
else{ // everything is ok, load original image
echo "<td width=\"15%\"><img src=\"../pics/thumbs/{$row['part_numbers']}.jpg\"></img>";
}
|