Password protecting directories.

Whether you are using Linux on the desktop or as a server, it's still good that you're using Linux. Linux related questions go here.

Moderator: General Moderators

Post Reply
User avatar
Todd_Z
Forum Regular
Posts: 708
Joined: Thu Nov 25, 2004 9:53 pm
Location: U Michigan

Password protecting directories.

Post 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?
User avatar
neophyte
DevNet Resident
Posts: 1537
Joined: Tue Jan 20, 2004 4:58 pm
Location: Minnesota

Post 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?
User avatar
phpScott
DevNet Resident
Posts: 1206
Joined: Wed Oct 09, 2002 6:51 pm
Location: Keele, U.K.

Post by phpScott »

what is your server running?
Post Reply