DeepakJ Posted August 1, 2007 Share Posted August 1, 2007 How can I create a password prompt that comes up when someone tries to access the pages which can impact the database. Quote Link to comment https://forums.phpfreaks.com/topic/62930-implementing-password-protection/ Share on other sites More sharing options...
Caesar Posted August 1, 2007 Share Posted August 1, 2007 .htaccess, if you're on an Apache server. But if these are files your other pages/scripts use...they will be prompted for the login from there. (If I remember correctly) Quote Link to comment https://forums.phpfreaks.com/topic/62930-implementing-password-protection/#findComment-313335 Share on other sites More sharing options...
DeepakJ Posted August 1, 2007 Author Share Posted August 1, 2007 I want it to come up when you first access any of the pages related to the database but then not to come up when you link through the pages. Quote Link to comment https://forums.phpfreaks.com/topic/62930-implementing-password-protection/#findComment-313390 Share on other sites More sharing options...
Philip Posted August 1, 2007 Share Posted August 1, 2007 Why not just use a normal form, do you have to use the password prompt? Quote Link to comment https://forums.phpfreaks.com/topic/62930-implementing-password-protection/#findComment-313398 Share on other sites More sharing options...
DeepakJ Posted August 1, 2007 Author Share Posted August 1, 2007 Yes Quote Link to comment https://forums.phpfreaks.com/topic/62930-implementing-password-protection/#findComment-313407 Share on other sites More sharing options...
DeepakJ Posted August 1, 2007 Author Share Posted August 1, 2007 How do you use .htaccess. I have followed a tut and nothing happens.. Quote Link to comment https://forums.phpfreaks.com/topic/62930-implementing-password-protection/#findComment-313409 Share on other sites More sharing options...
Philip Posted August 1, 2007 Share Posted August 1, 2007 What was the code that you tried? http://www.he.net/faq/tutorials/htaccess/demo.html That's also a good demo on how to use .htaccess's user/password protection Quote Link to comment https://forums.phpfreaks.com/topic/62930-implementing-password-protection/#findComment-313414 Share on other sites More sharing options...
DeepakJ Posted August 1, 2007 Author Share Posted August 1, 2007 Ok it worked once and I got this error: Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, deepak@mecsoft.com and inform them of the time the error occurred, and anything you might have done that may have caused the error. More information about this error may be available in the server error log. This is my code: <Files .htaccess> order allow,deny deny from all </Files> AuthName "Restricted Area" AuthType Basic AuthUserFile /home/InputMaintainance/.htpasswd AuthGroupFile /dev/null require valid-user user:nOFfygzjeZs7Q Quote Link to comment https://forums.phpfreaks.com/topic/62930-implementing-password-protection/#findComment-313432 Share on other sites More sharing options...
DeepakJ Posted August 1, 2007 Author Share Posted August 1, 2007 how do you configure the httpd.config file to allow .htaccess Quote Link to comment https://forums.phpfreaks.com/topic/62930-implementing-password-protection/#findComment-313462 Share on other sites More sharing options...
DeepakJ Posted August 2, 2007 Author Share Posted August 2, 2007 Ok how do I configure the .htaccess file to work on local host. I keep on getting the 500 error Quote Link to comment https://forums.phpfreaks.com/topic/62930-implementing-password-protection/#findComment-313505 Share on other sites More sharing options...
DeepakJ Posted August 2, 2007 Author Share Posted August 2, 2007 I basically want to implement .htaccess password protection on my local computer to test it out before going to the server. I have AllowOverride all under htdocs and my .htaccess file looks like the following: AuthUserFile /localhost/InputMaintainance/.htpasswd AuthGroupFile /dev/null AuthName EnterPassword AuthType Basic require user mecsoft The folder my files are in (htpasswd too) is called InputMaintainance. For some reason, the password protectionscreen comes up once, I type in the info, and it gives the 500 error. I refresh and it still gives the 500 error. I must have spent 4 hours trying to figure this out yesterday. Help would be GREATLY appreciated. I would also like to add that I get the password thing every time I restart my computer and try to access the browser, but the 500 error pops up. I also think the problem lies in my file path but am unsure on how to change the syntax. Quote Link to comment https://forums.phpfreaks.com/topic/62930-implementing-password-protection/#findComment-314105 Share on other sites More sharing options...
Philip Posted August 2, 2007 Share Posted August 2, 2007 I don't know if it's going to change much, but instead of having localhost, go ahead and put the pull file address http://www.freewebmasterhelp.com/tutorials/htaccess/3 says: AuthName "Enter Password" AuthType Basic AuthUserFile /full/path/to/.htpasswd (possibly C:\wamp\www\InputMaintainance\.htpassword ) require user mecsoft "The /full/parth/to/.htpasswd should be changed to reflect the full server path to the .htpasswd file (more on this later). " Also, in the .htpassword file, make sure the passwords are encrypted, and that there is not a blank line above the first one. Quote Link to comment https://forums.phpfreaks.com/topic/62930-implementing-password-protection/#findComment-314240 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.