gtanzer Posted May 14, 2006 Share Posted May 14, 2006 I have spent hours and hours and still don't have a clue what I need to do..www.lifeinlegacy.com/list.phpI want to change the image listing to say yes or no if the picture is uploaded or not.What am I doing wrong, with this piece of datafunction ImageExists($image){ if(file_exists("/usr/local/psa/home/vhosts/lifeinlegacy.com" .$image)) return "Yes"; else return "Need Photo";} Link to comment https://forums.phpfreaks.com/topic/9652-does-the-image-exist-yes-or-no/ Share on other sites More sharing options...
.josh Posted May 14, 2006 Share Posted May 14, 2006 [code]function ImageExists($image) { if (file_exists("/usr/local/psa/home/vhosts/lifeinlegacy.com" .$image)) { return "Yes"; } else { return "Need Photo"; }}[/code]that is, assuming that the path is correct. Link to comment https://forums.phpfreaks.com/topic/9652-does-the-image-exist-yes-or-no/#findComment-35708 Share on other sites More sharing options...
toplay Posted May 14, 2006 Share Posted May 14, 2006 Crayon Violent, the only thing I see different in your post is the use of the curly braces which are optional when you're specifying just one statement to run on an 'if' or 'if-else'.gail, I assume when function is called $image has a forward slash followed by a filename (i.e. /picfile.jpg or /folder/picfile.jpg), right?Are you saying you're getting "Need Photo" when you know the file is there? Link to comment https://forums.phpfreaks.com/topic/9652-does-the-image-exist-yes-or-no/#findComment-35713 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.