working with .htaccess files

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
ecourt
Forum Newbie
Posts: 11
Joined: Mon Oct 13, 2003 9:53 pm

working with .htaccess files

Post by ecourt »

I am writing a php script that will send a password once a month to a list of users.

I wanted to use the same php script to send the email and to change the .htaccess file.

is there a function in php to encrypt a password for .htaccess files ?

Thanks
Nay
Forum Regular
Posts: 951
Joined: Fri Jun 20, 2003 11:03 am
Location: Brisbane, Australia

Post by Nay »

I think you can use fopen() to open up the .htaccess file, find the password line and edit it.

http://php.net/fopen

-Nay
evilMind
Forum Contributor
Posts: 145
Joined: Fri Sep 19, 2003 10:09 am
Location: Earth

Post by evilMind »

take a look at http://www.devbox.net/articles/viewarticle.php?aid=7 for an example php script that works with .htaccess and .htpasswd files

btw, .htaccess/passwd files use standard DES encryption
ecourt
Forum Newbie
Posts: 11
Joined: Mon Oct 13, 2003 9:53 pm

Post by ecourt »

yes- - I know how to work with the file itself -- what I am wondering about is the encryption used to store passwords in the .htaccess file.

After reading that article evilMind posted, I see what I need -- the crypt function (same as in pearl)

Thanks!!
Post Reply