scotch33 Posted October 27, 2006 Share Posted October 27, 2006 Hi,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.Thanks!John. Quote Link to comment https://forums.phpfreaks.com/topic/25289-autologin-to-htaccess-protected-directory-through-php-how/ Share on other sites More sharing options...
HuggieBear Posted October 27, 2006 Share Posted October 27, 2006 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.RegardsHuggie Quote Link to comment https://forums.phpfreaks.com/topic/25289-autologin-to-htaccess-protected-directory-through-php-how/#findComment-115304 Share on other sites More sharing options...
scotch33 Posted October 30, 2006 Author Share Posted October 30, 2006 That being the case - does anyone have any php password software / member area software that they can suggest as a good start? one that I can auto login via hidden form fields in the header would be the sort of thing I am after.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 Quote Link to comment https://forums.phpfreaks.com/topic/25289-autologin-to-htaccess-protected-directory-through-php-how/#findComment-116769 Share on other sites More sharing options...
justhost Posted March 10, 2007 Share Posted March 10, 2007 [quote author=HuggieBear link=topic=112913.msg458503#msg458503 date=1161946561]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.RegardsHuggie[/quote]Would you mind telling me how you would do this then?This would work for what I am trying to do.Thank you.Keith G Quote Link to comment https://forums.phpfreaks.com/topic/25289-autologin-to-htaccess-protected-directory-through-php-how/#findComment-204002 Share on other sites More sharing options...
mssakib Posted December 28, 2012 Share Posted December 28, 2012 thx guys....... Quote Link to comment https://forums.phpfreaks.com/topic/25289-autologin-to-htaccess-protected-directory-through-php-how/#findComment-1401880 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.