writing to .htacess and .htpasspwrd

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
RCartledge
Forum Newbie
Posts: 3
Joined: Wed Sep 18, 2002 3:29 am
Location: Newcastle, England
Contact:

writing to .htacess and .htpasspwrd

Post 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.
User avatar
Johnm
Forum Contributor
Posts: 344
Joined: Mon May 13, 2002 12:05 pm
Location: Michigan, USA
Contact:

Post 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
RCartledge
Forum Newbie
Posts: 3
Joined: Wed Sep 18, 2002 3:29 am
Location: Newcastle, England
Contact:

Post 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
User avatar
Johnm
Forum Contributor
Posts: 344
Joined: Mon May 13, 2002 12:05 pm
Location: Michigan, USA
Contact:

Post 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
RCartledge
Forum Newbie
Posts: 3
Joined: Wed Sep 18, 2002 3:29 am
Location: Newcastle, England
Contact:

Post 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
User avatar
Takuma
Forum Regular
Posts: 931
Joined: Sun Aug 04, 2002 10:24 am
Location: UK
Contact:

Post by Takuma »

Post Reply