autologin to .htaccess protected directory through php - how?
Posted 27 October 2006 - 10:19 AM
I have a site where the user arrives and is asked to validate themselves. If the validation is correct then the header of the php page takes them to site version a, if not they are given the choice of going to site version b or leaving completely.
Thats all done ands working - now I want to password protect site version A (an oscommerce install with private member prices) which I am planning to do with .htaccess.
Where I come unstuck is how to use php to send the .htaccess username and password in the header so that the user does not have to log in. This is because users are members of groups that will know their group details but we don't ever want them to have the actual login and password to the protected directory.
Is there a was of doing this, or if not, is there a better way to protect the directory and then have the header/form auto login to the system.
(Plato - honest!)
Posted 27 October 2006 - 10:56 AM
Links: PHP Docs :: RegEx's :: MySQL :: DevGuru :: w3schools
Posted 30 October 2006 - 03:32 PM
Failing that I guess I can simply put an if query in the header of each 'memberpage' so that if the cookie I store on the user's pc containing a password etc will validate or if not will send them elsewhere.
Apart from the potential for users not accepting cookies can anyone see an issue with this method
(Plato - honest!)
Posted 10 March 2007 - 01:04 AM
I think that the short answer is no. It can be done the other way around, you can log into an .htaccess protected directory and automatically be authenticated with php, but not the other way around.
Would you mind telling me how you would do this then?
This would work for what I am trying to do.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users