I'm having trouble password protecting the administration section for a web site :(
For some reason, my attempts at htaccess / htpasswd are not working!
I am getting the login window asking me for a username / password, but it does not seem to be reading my .htpasswd file; typing the correct password does not let me enter! (The login window just pops up again).
First off here is the .htaccess file. Seems to be in working order...
And here is that .htpasswd file
If any errors jump out at you, please let me know!
So I gave up on the whole htpasswd end of things and went with PHP sessions instead.
However, it is horrible to work with; I have to go through every single file which I want protected and add a little bit of code to the top. If I don't, that page is open for anyone to mess with. Big problem, since there are /a lot/ of files, and a good chance that some of them will be later replaced by others. (Which do not have the added check).
So, both solutions are bad.
-Is there perhaps a way to tell the server to add a bit to the top of every file within a directory (probably via .htaccess), without me manually making any changes to the actual files?
-Also, a bit less importantly, do you know of a PHP-powered secure login system? I've seen a few, but they tend to be really 'fancy', and they also generally require a MySQL database. (I would be very happy with one that interfaced directly with the web server's htaccess authentication stuff instead of using a bloody database to hold about 3 user accounts). All it really needs is changing passwords / adding users, which I expect exists in just about any such account system.
For some reason, my attempts at htaccess / htpasswd are not working!
I am getting the login window asking me for a username / password, but it does not seem to be reading my .htpasswd file; typing the correct password does not let me enter! (The login window just pops up again).
First off here is the .htaccess file. Seems to be in working order...
AuthUserFile /home/mysite/.htpasswd AuthName "admin" AuthType Basic require valid-user
And here is that .htpasswd file
dhs:myencryptedpassword
If any errors jump out at you, please let me know!
So I gave up on the whole htpasswd end of things and went with PHP sessions instead.
However, it is horrible to work with; I have to go through every single file which I want protected and add a little bit of code to the top. If I don't, that page is open for anyone to mess with. Big problem, since there are /a lot/ of files, and a good chance that some of them will be later replaced by others. (Which do not have the added check).
So, both solutions are bad.
-Is there perhaps a way to tell the server to add a bit to the top of every file within a directory (probably via .htaccess), without me manually making any changes to the actual files?
-Also, a bit less importantly, do you know of a PHP-powered secure login system? I've seen a few, but they tend to be really 'fancy', and they also generally require a MySQL database. (I would be very happy with one that interfaced directly with the web server's htaccess authentication stuff instead of using a bloody database to hold about 3 user accounts). All it really needs is changing passwords / adding users, which I expect exists in just about any such account system.