Hi, I'm doing some tutoring at uni and I have set-up a site for students to access files. However, I don't want the whole public to access site, so would like a login window, where user has puts in username and password. I have seen this pop-up kind of window that drops down from the top of the browser and then user can add login details. Sorry I can't find a working example off the top of my head. How is this put together? Is this something I can switch on with my host or does it involve programming? Thanks
Check these out: http://www.bc.edu/helpdocs/WEB-pwssecurefolder.shtml http://ag.arizona.edu/ecat/web/password-protect.html and many more if you search google.
You need to put two files in the folder you wish to password protect. Those two files are: 1) .htaccess 2) .htpasswd Your .htacess file should look like this: AuthUserFile /path/to/your/folder/.htpasswd AuthName "Password Protected Zone" AuthType Basic require valid-user Code (markup): Of course, in example above you need to change that /path/to/your/folder/ to actual path to your folder where you want to place your protected files, OR where you want to place that .htpasswd file (which contains username/password combinations). Note that .htpasswd does not have to be in the same folder which is password protected, just place your correctpath to .htpasswd in your .htaccess file and that's it. Your .htpasswd file should look something like this: username1:crypted_password1 username2:crypted_password2 username3:crypted_password3 Code (markup): etc. So each Usernameassword combination goes in new line. Do not lave spaces on the end of line. Password also has to be crypted, you can do this via some site... for example through this site: http://css.psu.edu/publish/htpasswd/htpasswd.html or http://www.htaccesstools.com/htpasswd-generator/ etc. You can use google to search for "htpasswd generator" for other sites. I hope this helps. Note 1: .htaccess and .htpasswd files need to have that dot (.) on the beginning of the filename. Note 2: It may happen after uploading that you won't be able to see those two files, depending on which ftp client are you using to upload. Some ftp clients do not show files beginning with a . (dot) considering such files as hidden. So don't worry about it in that case, just when you want to upload new .htpasswd with new user/pass combinations just re-upload it to that same folder, and old file will be overwritten.