asmith Posted January 13, 2008 Share Posted January 13, 2008 $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 Quote Link to comment https://forums.phpfreaks.com/topic/85783-solved-is_file-quick-question/ Share on other sites More sharing options...
twostars Posted January 13, 2008 Share Posted January 13, 2008 $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 Quote Link to comment https://forums.phpfreaks.com/topic/85783-solved-is_file-quick-question/#findComment-437830 Share on other sites More sharing options...
asmith Posted January 13, 2008 Author Share Posted January 13, 2008 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) Quote Link to comment https://forums.phpfreaks.com/topic/85783-solved-is_file-quick-question/#findComment-437834 Share on other sites More sharing options...
twostars Posted January 13, 2008 Share Posted January 13, 2008 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. Quote Link to comment https://forums.phpfreaks.com/topic/85783-solved-is_file-quick-question/#findComment-437839 Share on other sites More sharing options...
asmith Posted January 13, 2008 Author Share Posted January 13, 2008 as you wish Quote Link to comment https://forums.phpfreaks.com/topic/85783-solved-is_file-quick-question/#findComment-437844 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.