Jump to content

Archived

This topic is now archived and is closed to further replies.

jaronblake

Picture not found!

Recommended Posts

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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.