son Posted July 31, 2009 Share Posted July 31, 2009 I use the getimagesize function to display product photos whose names are stored in db and which are always stored in same folder. The code for getimagesize bit is: $size = getimagesize("../products/basket/{$img}"); Now, I had to delete the files on server to run a test and names were still stored in database. Accessing this page which displays the photos it obviously threw some errors as there were no photos with relevant names (taken from db). It should not be the case that there are image names in database and no files on server, but you never know... What would I need to do before useing the getimagesize function to make sure it only runs if there is a file on server? Maybe even display a placeholder image then...Son Link to comment Share on other sites More sharing options...
justsomeguy Posted July 31, 2009 Share Posted July 31, 2009 http://www.php.net/manual/en/function.file-exists.php Link to comment Share on other sites More sharing options...
son Posted July 31, 2009 Author Share Posted July 31, 2009 http://www.php.net/manual/en/function.file-exists.phpmany thanks,Son Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.