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
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

 

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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