PHP takes MAC address with absolute IP

Source: Internet
Author: User
PHP takes MAC address and absolute IP
/*
* Created on June 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];

?>
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.