Page 1 of 1

working with .htaccess files

Posted: Mon Oct 13, 2003 9:53 pm
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

Posted: Tue Oct 14, 2003 4:05 am
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

Posted: Tue Oct 14, 2003 7:16 am
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

Posted: Tue Oct 14, 2003 10:29 am
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!!