using scripts to write to .htaccess files...

jm_jackson used Ask the Experts™
I want to secure a directory on an apache server (using the .htaccess file etc...) but I want users to be able to enter their details (i.e. username, password) and then for them to be given instant access to the directory. How can I let a user be added to the list of accepted users by entering their details via a form on a web page? Any help would be appreciated.
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®


make one .htaccess file and then every time u create new user add new user to it by script.

Use regular expresion for that. and file functions

hummm.. this is not much help but just an idea (will work!).



anybody got any actual examples of scripts they would use? Finding it a bit hard to decide what method would be best!

Use the module Apache::Htpasswd available on Cpan.
It allows easy creation, modification and removal of entries in a specified htaccess file.


Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial