View Single Post
  #4 (permalink)  
Old 12-20-2008, 04:18 AM
edhan's Avatar
edhan edhan is offline
WebProWorld Veteran
WebProWorld MVP
 
Join Date: Aug 2003
Location: Singapore
Posts: 758
edhan RepRank 4edhan RepRank 4edhan RepRank 4edhan RepRank 4edhan RepRank 4
Question Re: How to show default picture?

Code:
 if (file_exists('$siteurl/photo/$photoid.$ext')) {
   echo "Product: <img src='$siteurl/photo/$photoid.$ext'><a href='$siteurl/$product.html'><font color=Red>$product</font></a><br />";
Seems like this code does not check for the photo existence as it simply shown the emptypic.jpg instead even though there is a photo.
Code:
 } else {
   echo "Product: <img src='$siteurl/nophoto/emptypic.jpg'><a href='$siteurl/$product.html'><font color=Red>$product</font></a><br />";
 }
Anyway to ensure that file exist command really check for the existence before jumping into the else command to show the default photo?

Any suggestion is greatly appreciated.
Reply With Quote