How can I get the MAC and the IP address of a connected client in PHP?

前端 未结 16 2384
长发绾君心
长发绾君心 2020-11-22 02:29

I need to know the MAC and the IP address of the connect clients, how can I do this in PHP?

16条回答
  •  被撕碎了的回忆
    2020-11-22 03:00

    too late to answer but here is my approach since no one mentioned this here:
    why note a client side solution ?
    a javascript implementation to store the mac in a cookie (you can encrypt it before that)
    then each request must include that cookie name, else it will be rejected.
    to make this even more fun you can make a server side verification
    from the mac address you get the manifacturer (there are plenty of free APIs for this)
    then compare it with the user_agent value to see if there was some sort of manipulation:
    a mac address of HP + a user agent of Safari = reject request.

提交回复
热议问题