Jump to content


Photo

Picture not found!


  • Please log in to reply
2 replies to this topic

#1 jaronblake

jaronblake
  • Members
  • PipPip
  • Member
  • 17 posts

Posted 11 August 2006 - 11:42 PM

What I'm trying to do is setup in mysql row to have a picture name to go with my item. example: name: cup; picture:cup.jpg
This works fine when in php i try to pull up the picture when i pull up the item as long as i have my picture stored in the folder.
But, what i want to do is if the picture is not in the folder or i have not spelled something correctly then i want it to default to a defaut picture. Is there some way to do this?

#2 akitchin

akitchin
  • Staff Alumni
  • Advanced Member
  • 2,516 posts
  • LocationCalgary, AB, Canada

Posted 11 August 2006 - 11:44 PM

file_exists() can tell you whether the file is there or not.  use a simple if-else statement to show either the photo or the default image based on the results of the function.

#3 jaronblake

jaronblake
  • Members
  • PipPip
  • Member
  • 17 posts

Posted 11 August 2006 - 11:46 PM

thank you very much





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users