Page 1 of 1

Password protecting directories.

Posted: Tue Jun 28, 2005 6:25 pm
by Todd_Z
I used the following code to create myself the encrypted password for the .htpasswd file:

Code: Select all

function htpasswd ( $pass ) { 
     $pass = crypt(trim($pass),base64_encode(CRYPT_STD_DES)); 
     return $pass; 
}

Code: Select all

AuthType Basic
AuthUserFile /XXXXX/YYYYY/.htpasswd
AuthName &quote;This section is for Administration Only.&quote;
require valid-user
Do I need to enable something on my server to be able to use .htaccess directory protecting?

Posted: Tue Jun 28, 2005 10:46 pm
by neophyte
I think there is some settings for .htaccess. But I'm not much help there. Did you try exec("htpasswd [options]"); to create the user and password?

Posted: Wed Jun 29, 2005 3:39 am
by phpScott
what is your server running?