Reputation: 547
How to get the HTTP authenticated user name in PHP?
Upvotes: 0
Views: 184
Reputation: 6354
This is the answer you are looking for:
$username = $_SERVER['PHP_AUTH_USER'];
$password = $_SERVER['PHP_AUTH_PW'];
Upvotes: 1
Reputation: 157981
$_SERVER['REMOTE_USER']
if PHP run as an Apache module, and quite tricky with anything else
BTW, phpinfo()
often helps with such matters
Upvotes: 0