dtz88967 2017-02-21 12:17
浏览 44
已采纳

是否可以使用Windows身份验证读取用户的计算机名称?

Long story short, I'm looking for a way to insert users into database, that are read from LDAP (that part is easy) automatically when a user accesses a page.

I want to automatically fetch the user's machine name, and then fetch user details from LDAP with that machine name.

And I'm stuck at the very first step - fetching user's machine name. Currently using PHP 5.4 and Apache.

  • 写回答

1条回答 默认 最新

  • doudan1123 2017-02-21 12:34
    关注

    In PHP, you can use $_SERVER['REMOTE_ADDR'] to get the IP address of the remote client. Using this use gethostbyaddr() to get the IP into a hostname (but that IPs should have a reverse mapping configured else it will not give desired result)

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?