LinuxQuestions.org

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

newuser455 06-11-2006 03: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 11:00 AM

More details, please.

newuser455 06-12-2006 11:12 AM

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 06:08 AM.