PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I would like to password protect a folder. I am not sure where to ask this so I thought I would ask the fine people here. I use Debian running apache. I heard from someone that with the pear package you can do this. I dont use the htaaccess.
Well... you can use PHP's User Auth thats built in, but that won't protect a whole directory, just the files you put it on. php.net/features.http-auth for more information on that. The only other way that I'm aware of is using .htaccess. Hope that helps.
AuthType Basic
AuthName "My Sites Secureness"
AuthUserFile /path/to/.htpasswd
Require valid-user
For the .htpasswd file, just use Apache's built in program to make .htpasswd files from the command prompt. If you want to learn more about it, search http://www.apache.org for more infomation on .htpasswd. The program used is infact called htpasswd so if you search for that, it should give you a couple of pages that should work fairly well. Hope that helps.