Page 1 of 1

writing to .htacess and .htpasspwrd

Posted: Wed Sep 18, 2002 3:29 am
by RCartledge
Is it possible ot create a php page that would write to .htaccess and the .htpasswrd files and add usernames and passwords to them.

I should make you aware that i am an absolutly newbie PHP and only know how to echo things onto a page.

If you think that this is too out of my range and would be too hard to comprehend, just tell me.

Posted: Wed Sep 18, 2002 7:10 am
by Johnm
Well, it is possible, it is probably out of your range, how to do it depends on the system you run, and you probably want to use a different approach any way. What are you trying to do and why?

Direwolf

Posted: Wed Sep 18, 2002 11:16 am
by RCartledge
I'm wanting it so that a user could fill in there desired username and password, and the script would check if it is unique. if it is, then add them to the files and take them to the confirmation page which would display there info ythey just entered

Posted: Wed Sep 18, 2002 12:02 pm
by Johnm
If you have access to a database, I would create a users table there with a primary key that is both the username and password. Then create a logon script.

Generaly, I protect those files.

Direwolf

Posted: Wed Sep 18, 2002 12:31 pm
by RCartledge
Thanks for the help, i'll have to read up on how to connect to a database tho but i'll give it a shot

Posted: Wed Sep 18, 2002 3:51 pm
by Takuma