about file_exists

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
vb_123
Forum Newbie
Posts: 19
Joined: Wed May 21, 2008 2:16 am

about file_exists

Post by vb_123 »

hello friends,
i want to know if "file_exists" function works on server or not??? i am giving image link path and checking it thru file_exists.but it is alwaz going on else part .is there any substitute of this function which works fine on server??
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Re: about file_exists

Post by Kieran Huggins »

Dollars to doughnuts it's a path issue. Try prepending $_SERVER['DOCUMENT_ROOT'] to the front of your path.
LBmtb
Forum Newbie
Posts: 23
Joined: Wed May 14, 2008 11:14 am

Re: about file_exists

Post by LBmtb »

Also check to make sure you have read access to that file. Try doing "is_readable('/path/to/your/image/')" to see if you have access to the directory that the image is under.
Post Reply