Jump to content

Php Folder Security


jandrews3

Recommended Posts

  Currently for file protection inside a folder I am attaching a hidden variable split up, scrambled and re-assembled and transmitted in links between pages on a website. Example: http:www.cnn.com?validate=4485jd02843yfdj384

Only the re-encoding element of each page knows how to re-assemble the validate variable and tests parts of it for authenticity. Since parts of it rely on the accuracy of date() elements and the users member id (split up), it provides good security. BUT ...

 

  I need to take over an ISP's folder security. They use the .htaccess method to protect a folder. This would be great but I have NO experience with it, and they say I cannot link the .htaccess method to a mysql database. Does PHP offer a way to protect a folder so I don't have to protect each file in it individually? THIS IS A BIG QUESTION FOR ME! Thanks!

Link to comment
Share on other sites

You cannot protect folders with php scripts, you can only protect php files.  I suggest you research .htaccess it is fairly simple.   

 

Now .htaccess can read from a mysql database.  You need the the module mod_auth_mysql.  Check your host.

 

How to use:  http://www.modwest.com/help/kb1-161.html

 

If you do not have that module.  The only other workaround I can think of is to use .htaccess to only allow links through your domain.  This means that people linking from another domain or going directly to the url will not work unless they are on your site.  The code is:

 

SetEnvIf Referer mydomain.com internal

 

<Limit GET POST>

order deny,allow

deny from all

allow from env=internal

</LIMIT>

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.