[PHP] ".htaccess login id"

2002-02-18 Thread Mohamed Ismail Bulale


To get username and password with php, use this below code:

$headers = getallheaders(); 
$auth=$headers['Authorization'];
$pos = strpos($auth, ' '); 
$delivered_auth_type = strtolower(substr($auth, 0, $pos)); 
$authorization_params = substr($auth, $pos+1); 
//* analyse parameters 
if ($delivered_auth_type == 'basic') { 
$userpas = base64_decode($authorization_params);
list($loginname, $password) =
explode(':',base64_decode($authorization_params));
}
echo "Auth: $auth  login: $loginname - userpas: $password ";



Best regards,

Bulale
+-+
: Bulale Mohamed Ismail <[EMAIL PROTECTED]>   :
: Odegaard A/S:
: A company in the Oedegaard and Danneskiold-Samsoe Group :
: 15 Titangade, DK-2200 Copenhagen N, DENMARK :
: Switchboard:  +45 35 31 10 10   :
: Direct phone: +45 35 31 10 16   :
: Fax:  +45 35 31 10 11   :
: Home page: www.oedegaard.com:
+-+


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] .htaccess login id

2002-02-18 Thread Dave

Hi,

I currently have a directory of my web site access protected using .htaccess
and .htpasswd.

Is there any way of retrieving the user ID in PHP after the person
successfully logs in?

Thanks in advance
Dave




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php