Jump to content

help with file_exists


Darkmatter5

Recommended Posts

Here's my code:

 

The variables "$imagesml, $imagelrg and $imagesys are all created above this code.

 

if(file_exists("$imagesml")) { $imagesmla="The file $imagesml exists"; }

else { $imagesmla="The file $imagesml does not exist"; }

if(file_exists("$imagelrg")) { $imagelrga="The file $imagelrg exists"; }

else { $imagelrga="The file $imagelrg does not exist"; }

if(file_exists("$imagesys")) { $imagesysa="The file $imagesys exists"; }

else { $imagesysa="The file $imagesys does not exist"; }

 

<table>

  <tr><td>imagesml: <?php echo $imagesml; ?><br>imagelrg: <?php echo $imagelrg; ?><br>imagesys: <?php echo $imagesys; ?></td></tr>

  <tr><td>imagesmla: <?php echo $imagesmla; ?><br>imagelrga: <?php echo $imagelrga; ?><br>imagesysa: <?php echo $imagesysa; ?></td></tr>

</table>

 

Here's the output from that code:

imagesml: http://www.thealienhive.com/facebook/ent-trader/images/logos/i101-small.png

imagelrg: http://www.thealienhive.com/facebook/ent-trader/images/logos/i101-full.png

imagesys: http://www.thealienhive.com/facebook/ent-trader/images/logos/icon-256 360.png

imagesmla: The file http://www.thealienhive.com/facebook/ent-trader/images/logos/i101-small.png does not exist

imagelrga: The file http://www.thealienhive.com/facebook/ent-trader/images/logos/i101-full.png does not exist

imagesysa: The file http://www.thealienhive.com/facebook/ent-trader/images/logos/icon-256 360.png does not exist

 

If you copy and paste the links you'll see they do in fact exist.  This is a Facebook application, but the PHP code is all resides on the same location as the image files being checked for.  What might I be doing wrong?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.