How can I get the authenticated user name under Apache using plain HTTP authentication and PHP? *

Question

First, let's get the security considerations out of the way. I'm using simple authentication under Apache for a one-off, internal use only, non-internet connected lan, php web app.

How can get I the HTTP authenticated user name in PHP?

Answer

I think that you are after this

$username = $_SERVER['PHP_AUTH_USER'];
$password = $_SERVER['PHP_AUTH_PW'];
< br > via < a class="StackLink" href=" http://stackoverflow.com/questions/1417/" >How can I get the authenticated user name under Apache using plain HTTP authentication and PHP?< /a>
Share on Google Plus

About Cinema Guy

This is a short description in the author block about the author. You edit it by entering text in the "Biographical Info" field in the user admin panel.
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment