LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   PHP generate htpasswd (http://www.linuxquestions.org/questions/programming-9/php-generate-htpasswd-453775/)

newuser455 06-11-2006 04:30 PM

PHP generate htpasswd
 
What do I need to do with PHP to encrypt a password for use in a .htpasswd file?

fedora4002 06-12-2006 12:00 PM

More details, please.

newuser455 06-12-2006 12:12 PM

I think I have what I want.

PHP Code:

// Encrypt a password for a .htpasswd file.
function enc_pass($pass)
{
    
$pass crypt(trim($pass),base64_encode(CRYPT_STD_DES));
    return 
$pass;




All times are GMT -5. The time now is 08:04 AM.