Jump to content

Protected Directory...


clievers

Recommended Posts

Hello,

[b]Problem[/b]:

I need to have password protection on a directory and all of its content and subfolders. Essentially it's a "client area" of a website. In this directory will contain regular php script files to display pages, but there will also be links to PDF files, and regular html websites for beta-testing, etc.

I need to be able to say http://www.site.com/client/client1/* is locked down to only those client1 users specified in a mysql database. For PHP scripts this should be fairly simple in that you can write code at the beginning to check for this. But links to PDF files, as well as running HTML files in these folders can't be handled by PHP.

Is there some sort of way in Apache to specify for a directory that a certain PHP script will execute PRIOR to the requested URL being allowed? This way, in this "script", I could put the authorization code in the script file.

Please Note: I cannot use .htaccess/htpasswd/htgroup files for this because I cannot have the standard little authentication box "pop" up. It needs to be done through PHP forms.

Thanks very much in advance.
Cory
Link to comment
Share on other sites

  • 2 weeks later...
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.