fubarur Posted October 18, 2006 Share Posted October 18, 2006 Hello,I've done some searching around the forums and can't seem to find anything to fit my need.What I'm trying to do:Page that displays a certian set of stores by pulling out of the database and displays an image next to each store listing.I have the script all setup and is looking in a folder /images/dealers/ and looks for a image with dealer_id and displays it fine. but if there is no image for that dealer instead of displaying a broken image havng no image would be better.[code] <td width="50%" align="right"> <img border="1" src="<?=Environment::webroot()?>/images/dealers/<?=$row['id']?><?=$ext?>" /> </td>[/code]Like I said it displays images fine but I don't want it to display broken images if it can't find and image.Any help is appreciated!Thanks... Quote Link to comment Share on other sites More sharing options...
fubarur Posted October 18, 2006 Author Share Posted October 18, 2006 I figured it out[code] <td width="50%" align="right" class="font-smx"> <?phpif (file_exists('/var/www/html/images/dealers/' . $row['id'] . $dthumb)):?> <img border="1" src="<?=Environment::webroot()?>/images/dealers/<?=$row['id']?><?=$dthumb?>" /> <?phpendif;?> </td>[/code] Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.