Jump to content

PHP Security of Folder


SarahB12

Recommended Posts

Hey guys!

I am looking to secure some (pdf, doc, xls) files in a folder on my site.  The problem is I don't have the option of .htaccess which is how I typically secure these files.  I also would like to avoid .Net (web.cofig) since all of my pages are coded in php.  Are there any other options for securing a folder using php/mysql?  I have searched online, but I cannot find any resources for php security of folders.

 

Thanks!

~SarahB~

Link to comment
https://forums.phpfreaks.com/topic/201633-php-security-of-folder/
Share on other sites

You should put the files in a folder that is not accessible through the web, i.e. not in the web root. You can then build a PHP front-end interface to allow a user to authenticate and request the files. PHP can then "read" the documents from the server-side and serve them to the user.

 

Example:

|
|-Web Root
|  |
|  |-images
|  |-css
|  |-html files
|  |-php scripts
|
|-Secured documents

 

Thanks for the suggestion mjdamato! I was able to find a resource that worked for me!

 

~SarahB~

 

You should put the files in a folder that is not accessible through the web, i.e. not in the web root. You can then build a PHP front-end interface to allow a user to authenticate and request the files. PHP can then "read" the documents from the server-side and serve them to the user.

 

Example:

|
|-Web Root
|  |
|  |-images
|  |-css
|  |-html files
|  |-php scripts
|
|-Secured documents

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.