如何使用PHP检测访问我们网站的用户的MAC地址? [英] How to detect the MAC address of the user viewing our website using PHP?

查看:311
本文介绍了如何使用PHP检测访问我们网站的用户的MAC地址?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道如何跟踪IP地址,但是我需要跟踪查看我的页面的用户的MAC地址.

I know how to track down an IP address, but I need to track down the MAC address of the users viewing my page.

如何做到这一点?

推荐答案

除非用户与Web服务器在同一LAN中,否则您不能这样做. MAC地址位于TCP/IP下方的以太网层上,并且不包含在通过用户本地网络路由的TCP/IP数据包中.

Unless the user is on the same LAN as the webserver, you cannot do this. MAC addresses are on the ethernet layer below TCP/IP, and are not included in TCP/IP packets routed off the users local network.

在某些环境中,可能可以使用客户端插件来允许Javascript访问MAC地址,并将该信息传输到服务器.

In some environments, it might be possible use to a client-side plugin to allow Javascript access to the MAC address, and transmit that information to the server.

如果此一种基于LAN的Web应用程序,则可以尝试从ARP缓存中获取MAC地址.具体操作方式取决于操作系统,但是在Linux下,您可以解析arp -n

If this is some kind of LAN based web application, you could try getting the MAC address out of the ARP cache. How you do this will depend on the operating system, but under Linux you could parse the output of arp -n

这篇关于如何使用PHP检测访问我们网站的用户的MAC地址?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆