Poi*_*nty 37
MAC地址(低级本地网络接口地址)不能通过IP路由器生存.您无法从远程服务器找到客户端MAC地址.
在本地子网中,MAC地址通过ARP系统映射到IP地址.本地网络上的接口知道如何将IP地址映射到MAC地址.但是,当您的数据包已在本地子网上路由到(并通过)网关到"真正的"Internet时,原始MAC地址将丢失.简单地说,数据包的每个子网到子网跳都涉及每个子网中本地路由的相同类型的IP到MAC映射.
小智 9
echo GetMAC();
function GetMAC(){
ob_start();
system('getmac');
$Content = ob_get_contents();
ob_clean();
return substr($Content, strpos($Content,'\\')-20, 17);
}
Run Code Online (Sandbox Code Playgroud)
小智 5
这是一种可能的方法:
$string=exec('getmac');
$mac=substr($string, 0, 17);
echo $mac;
Run Code Online (Sandbox Code Playgroud)
如果客户端运行 Windows 并允许您安装 ActiveX 控件,您可以在 javascript 中获取客户端的 MAC 地址。
http://www.eggheadcafe.com/community/aspnet/3/10054371/how-to-get-client-mac-address.aspx
http://codingresource.blogspot.com/2010/02/get-client-mac-address-ip-address-using.html