Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

using file_exists with paths - assistance please

Status
Not open for further replies.

bradoirs

Technical User
Jul 8, 2009
35
0
0
GB
Assistance please

Desparately trying to implement file_exists but really struggling with the paths

basically my php app will be:


The images to check for (as an example) will be


Any suggestions welcomed - very new to PHP and have taken the easy route of having files and code in same directory but need to get to grips with central store for image files.
 
Code:
if(file_exists('../imageslib/p154.jpg')):
//do something
endif;

or
Code:
if(file_exists($_SERVER['DOCUMENT_ROOT'] . '/workingon/imageslib/p154.jpg')):
//do something
endif;

or loads of other ways.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top