Forum Moderators: phranque

Message Too Old, No Replies

User Authentication

Automated User Creation Form

         

wfernley

2:43 pm on Mar 13, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I was curious if it is possible to make a form that allows a user to register and once registered the registration form will add that user and password to an apache user/password file that allows them to login using Apaches User Authentication.

Has anyone done this before?

Thanks in advance for your help!

Wes

webdoctor

1:13 pm on Mar 14, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Which scripting language are you using?

If you're using PHP, you could open the passwd file and modify it based on user input. Just make sure the file has the right permissions.

I'd have thought a better solution would be to store usernames and passwords in some kind of database backend (MySQL, pgsql, ...), rather than in a flat apache passwd file. That way you can extend what is stored - e.g. user preferences / user tracking / ...

apache2-mod_auth_mysql could be your friend in this situation if you're determined to have basic authentication rather than form authentication.