".htaccess login id"
| From: | Mohamed Ismail Bulale | Date: | Mon, 18 Feb 2002 14:57:34 +0000 |
| Subject: | ".htaccess login id" | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-85207@lists.php.net to get a copy of this message | ||
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 <br> login: $loginname - userpas: $password <br>";
Best regards,
Bulale
+---------------------------------------------------------+
: Bulale Mohamed Ismail <mib@oedegaard.com> :
: 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 :
+---------------------------------------------------------+