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

跟風遠走 提交于 2019-12-03 08:04:32

问题


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?


回答1:


I think that you are after this

$username = $_SERVER['PHP_AUTH_USER'];
$password = $_SERVER['PHP_AUTH_PW'];


来源:https://stackoverflow.com/questions/1417/how-can-i-get-the-authenticated-user-name-under-apache-using-plain-http-authenti

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!