PHP取Mac地址跟绝对IP
程序员文章站
2022-05-22 19:12:27
...
PHP取Mac地址和绝对IP
/*
* Created on Jun 18, 2010
*
* To change the template for this generated file go to
* Window - Preferences - PHPeclipse - PHP - Code Templates
*/
unset($onlineip);
if(getenv('HTTP_CLIENT_IP')) {
$onlineip = getenv('HTTP_CLIENT_IP');
} elseif(getenv('HTTP_X_FORWARDED_FOR')) {
$onlineip = getenv('HTTP_X_FORWARDED_FOR');
} elseif(getenv('REMOTE_ADDR')) {
$onlineip = getenv('REMOTE_ADDR');
} else {
$onlineip = $HTTP_SERVER_VARS['REMOTE_ADDR'];
}
//echo $onlineip;
@exec("ipconfig /all",$array);
for($Tmpa;$Tmpa if(eregi("Physical",$array[$Tmpa])){
$mac=explode(":",$array[$Tmpa]);
}
}
echo $mac[1];
?>
/*
* Created on Jun 18, 2010
*
* To change the template for this generated file go to
* Window - Preferences - PHPeclipse - PHP - Code Templates
*/
unset($onlineip);
if(getenv('HTTP_CLIENT_IP')) {
$onlineip = getenv('HTTP_CLIENT_IP');
} elseif(getenv('HTTP_X_FORWARDED_FOR')) {
$onlineip = getenv('HTTP_X_FORWARDED_FOR');
} elseif(getenv('REMOTE_ADDR')) {
$onlineip = getenv('REMOTE_ADDR');
} else {
$onlineip = $HTTP_SERVER_VARS['REMOTE_ADDR'];
}
//echo $onlineip;
@exec("ipconfig /all",$array);
for($Tmpa;$Tmpa
$mac=explode(":",$array[$Tmpa]);
}
}
echo $mac[1];
?>
相关文章
相关视频
上一篇: 关于PHP操作SQL增加数据的有关问题
下一篇: ie 不能 和其他浏览器同时打开