PHP obtains the Mac address and absolute IP Address & lt ;? Php ** CreatedonJun18, 2010 ** Tochangethetemplateforthisgeneratedfilegoto * Window-Preferences-PHPeclipse-PHP-CodeTemplates * uns PHP takes the Mac address and absolute IP address
/*
* Created on Jun 18,201 0
*
* To change the template for this generated file go
* 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];
?>