Jump to content

require_once with security concern


samoht

Recommended Posts

Hello all,

 

I have a directory on my server that I would like to protect so that people cannot open and see the files - easy enough  - But I also need to access these files from within my site using a require_once () or an include() but if the files and directory are protected How can I??

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/157954-require_once-with-security-concern/
Share on other sites

By moving the directory outside of the website document root

 

i.e

# document root

public_html

# includes directory

public_html/includes

 

 

to

# document root

public_html

# includes directory

includes

 

You can still include files from the includes directory in your scripts using the correct path however there is no access publically i.e http://www.xyz.com/includes

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.