Include File from Non-Public_HTML Folder [SOLVED]

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
User avatar
tecktalkcm0391
DevNet Resident
Posts: 1030
Joined: Fri May 26, 2006 9:25 am
Location: Florida

Include File from Non-Public_HTML Folder [SOLVED]

Post by tecktalkcm0391 »

Since PHP is server-side, can't you include or require a file that is not accessable to users outside of the server?

I am just wonder, I am pretty sure you can, but I want to make sure I am right...
Last edited by tecktalkcm0391 on Mon Jun 12, 2006 6:40 pm, edited 1 time in total.
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Post by alex.barylski »

Yes...in PHP you can inlude files which are inaccesable to the outside world...

For instance in a .htaccess protected directory or outside document root...
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post by Christopher »

It is actually a best practice to only include files from locations that are not publically accessible.
(#10850)
Post Reply