Jump to content

[SOLVED] is_file quick question


asmith

Recommended Posts

$file_path =  "http://localhost/html/image3.jpg";

if (is_file($file_path))
{
echo "yes";
}

 

 

is not working .  i copy and paste the url into the browser, it shows the image , but is_file is not finding it , wht's wrong ?

 

thanks

 

 

In that instance, I believe the function you are wanting to use is: file_exists();

 

But then, you need to use an absolute or relative server path.

Such as:

./html/image3.jpg < relative

or

C:\Apache2\htdocs\html\image3.jpg < absolute

or

/home/mydomain/htdocs/html/image3.jpg < *nix absolute

Link to comment
Share on other sites

thanks a lot . solved

 

 

btw , i've seen you always quote a post before typing your answer .  it is a bad habit most of the times, for example in this thread it was obvious you are replying to my post, why quoting it ??  ( no offense)

Not really a bad habit, but its easier to see the quote button than the reply button.

Also easier to see what I'm replying to, as opposed to scrolling down the page.  ;)

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.