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?

By : basszero


Answers

I think that you are after this

$username = $_SERVER['PHP_AUTH_USER'];
$password = $_SERVER['PHP_AUTH_PW'];
By : Teifion


As a side note, if you're trying to get XAMPP to use a network drive as your document root you have to use UNC paths in httpd.conf. XAMPP will not recognize your mapped network drives.

For example the following won't work, DocumentRoot "X:/webroot"

But this will, DocumentRoot "//192.168.10.100/webroot" (note the forward slashes, not back slashes)

By : Jason


This video can help you solving your question :)
By: admin