Jump to content

Archived

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

gtanzer

Does the Image exist yes or no

Recommended Posts

I have spent hours and hours and still don't have a clue what I need to do..

www.lifeinlegacy.com/list.php

I 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 data

function ImageExists($image)
{
if(file_exists("/usr/local/psa/home/vhosts/lifeinlegacy.com" .$image))
return "Yes";
else
return "Need Photo";
}

Share this post


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

Share this post


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

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.