Web Hosting Talk







View Full Version : writing to a .htaccess & .htpasswd file


WreckRman2
09-02-2001, 04:54 PM
Does anyone have a PHP script or such that will take a username and password and insert the .htpasswd version in the .htpasswd file?

Example:

I want to create a membership form that when the account is entered in my db it also adds/writes the user/pass into the .htpasswd file giving that account access to the directory protected by the .htaccess file.

Reg
09-02-2001, 05:31 PM
There are currently two scripts that I know of that can do this for you. They are CGI Perl scripts. The first is called Password Manager. You can get it from http://www.cgi-world.com/password_manager.html. This will allow you take in user information and will automatically add usernames and passwords for you. The second one is called Account Manager. It can be found at http://cgi.elitehost.com. It performs the same features. Account Manager, however, allows for secure payments so if this is going to be a paid service, you can use Account Manager.

WreckRman2
09-02-2001, 07:51 PM
Thanks for the links however both do much more then I need. All I need is a way to send the user/pass to the file via a form and it creates and write the user/pass to the .htpasswd file for me. Any other scripts you know of?

Reg
09-02-2001, 08:01 PM
I'm sorry. I believe this script is what you may be looking for. It is also a CGI Perl script. It is called .HTPasswd Password Manager. You can get it from http://www.cgi-factory.com/password/index.shtml.

WreckRman2
09-02-2001, 10:18 PM
Perfect plus some. It even has a delete function. Thank you very much...

Reg
09-03-2001, 04:04 PM
You're welcome :)