它正在我的本地主机上工作。但是不能在我的服务器上工作。怎么了如何使用php从Windows系统获取Mac地址?
$MAC = exec('getmac');
$MAC = strok($MAC, ' ');
echo $MAC;
答案 0 :(得分:0)
如果用户使用的是Windows并且用户允许您安装ActiveX控件,那么您将无法使用php,甚至无法使用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
或者您可以尝试关注
cho GetMAC();
function GetMAC(){
ob_start();
system('getmac');
$Content = ob_get_contents();
ob_clean();
return substr($Content, strpos($Content,'\\')-20, 17);
}