Jump to content

Is_file and file_exists, cant get either to work, have tried for 2 days!


Clay Trainor

Recommended Posts

Hi, i had a previous post about this topic, but the title wasnt appropriately named so someone who might know the solution, could've overlooked it, so after a couple days of no success, i thought i'd make this topic.

 

 

I have been trying to detect whether a picture exists or not, using either is_file or file_exists, and I always get a FALSE readback, saying it doesnt exist, even though it does.

 

this is my code

<?php
$filepath = "http://www.mysite.com/pictures/tvshowdvd/Lost.jpg";
if (is_file($filepath)) {
    $img = $filepath;
} else {
    $img = "http://www.digitaltechnews.com/photos/uncategorized/netflix.gif";
}
?>

 

im pretty sure the code is right, i've been checking it over for days, but i just cant seem to get the functions to work.

 

any help is much appreciated, thank you.

 

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.