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
https://forums.phpfreaks.com/topic/171194-help-with-file_exists/
Share on other sites

Archived

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

×
×
  • 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.