May 8, 2001, 4:09 PM
Post #1 of 1
Ok, I searched the forum for .htaccess and found one thread with the exact same question I have, but it never got answered fully, so I am posting it again in greater detail:
having a script login to .htaccess for you
basically this is the scenario - say there are 10 people, and they each have their own directory protected by .htaccess/.htpassword. (seperate directories with different user/pass)
so rather than telling them to go to www.domain.com/theirdirectory and enter user/pass into the htaccess window, I want all 10 different users to be able to login from the same page (with forms) and basically the script would take them to their directory based on the username entered ( entered into the forms, not into .htaccess window) and the script would have the same function as "entering the user/pass into .htaccess window for them" . This means that they never see the .htaccess window, they login once from a page with forms, and then they are in their protected directory looking at whatever.html.
So basically the purpose is to have the protection of .htaccess, but with the convinience of having a common login area for the 10 users based on forms and different users get taken to different directories protected by different .htaccess files.
assume a script takes the info in from the forms in two variables - $user and $password.
I just need to see code for how these variables are used to go to whatever.html inside one of the .htaccess protected folders.
Thanks a lot!
If anything seems unclear as to what I'm trying to do, post a reply