There's a good article here:
http://hotwired.lycos.com/webmonkey/00/05/index2a.html
This gives you some different options using HTTP authentication headers which persist throughout an area.
For encrypting your password, try:
$password = "goodone";
$salt = "h7"; //or any other two character string to vary the encryption
$encrypted_pass = CRYPT($password,$salt);
print "$password<br>"
print "$encrypted_pass";
The result should be a 13 character UNIX DES encrypted string. Note that this cannot be unencrypted, so if you want to compare your password, you have encrypt it with the same salt and then compare the db result with your given password.
Hope this helps.