htaccess question

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
lazersam
Forum Contributor
Posts: 105
Joined: Sat Nov 15, 2003 4:07 am
Location: Hertfordshire, UK

htaccess question

Post by lazersam »

Hi all
Ive been stuck on this for ages! Although I have found related posts I still cant figure this one out! I want to protect a directory with .htaccess because it contains ebooks for my members to download. Can anyone give an example of what the htaccess code will look like when calling for authorisation from a mysql?

Also, do you know what chmod to set the protected directory?

Thanks

Larry.
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Post by Weirdan »

well, there's mod_auth.mysql mentioned here and there around the net, but all links appears to be dead.
Alternatively, you could have 'Deny from all' htaccess in your protected directory in conjunction with php script set as error page for 'forbidden' error which checks the $_SERVER['HTTP_AUTH_USER'] and $_SERVER['HTTP_AUTH_PW'] against the database (and outputs requested document if access is allowed).
Post Reply