i'm using the code <img src = "images/<?php echo $row_SubSearchDesc['itemImage']; ?>"> to pull a file name from a database such as "pic1.jpg" if this produces a broken image after it executes...is there anyway to write in an if statement for like the result to replace the broken image with something like "noimage.jpg" thank you very much in advance, i would greatly appreciate any help.
sean
replace broken image with generic logo
Moderator: General Moderators
Code: Select all
if (file_exists($filename)) {
// show the file
} else {
// otherwise, just diplay generic image
}