Htaccess from PHP

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
john_van_v
Forum Newbie
Posts: 6
Joined: Thu Jun 08, 2006 10:45 am
Contact:

Htaccess from PHP

Post by john_van_v »

Hello, I am looking for a way to utilize, and maintain, htaccess (and htpasswd)

Being a PHP noob, I am hoping to find a working php script which I can integrate into some simple file admin script.

Thanks in advance, John

PS the htaccess mod rewrite class came to mind, but being a noob... ;)
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

Are you talking abou a way to actually open, read/write to/remove from your .htaccess (& etc) files?
john_van_v
Forum Newbie
Posts: 6
Joined: Thu Jun 08, 2006 10:45 am
Contact:

Post by john_van_v »

Yeah, a tool to manipulate the files.

Also, since there are users and crypts in the htpasswd file, then it makes sense to use that to do the PHP authentication. This way you won't need MySQL.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

I am more a proponent of databases for any type of data storage, but to do what you want you can simply use the PHP filesystem series of functions.

Specifically you may want to look at the fopen(), fwrite() (or fputs()), fread() and fclose() functions.
john_van_v
Forum Newbie
Posts: 6
Joined: Thu Jun 08, 2006 10:45 am
Contact:

Post by john_van_v »

Hopefully, that work is done already, in classes. Question for me is finding them, or even better, finding a php script I can modify.

That is what I am asking.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

You may want to try Hotscripts. They have a decent selection of pre-built scripts to choose from.
Post Reply