Wednesday, April 8, 2009

Getting login password from Apache authentication using PHP

$headers = apache_request_headers();

$auth= $headers['Authorization'];

$autha = explode(' ',$auth);

$pair = base64_decode($autha[1]);

$authb = explode(':',$pair);

echo $login = $authb[0];

echo '\n';

echo $pass = $authb[1];

include this in php tags :)

No comments:

Post a Comment