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

后端 未结 1 1897
不知归路
不知归路 2021-02-03 17:23

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

相关标签:
1条回答
  • 2021-02-03 17:55

    I think that you are after this

    $username = $_SERVER['PHP_AUTH_USER'];
    $password = $_SERVER['PHP_AUTH_PW'];
    
    0 讨论(0)
提交回复
热议问题