Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
<?php
function GetMACAddress()
{
$retval = FALSE;
$command = '/sbin/arp -n | grep ' . $_SERVER['REMOTE_ADDR'];
$ARPTableLine = `$command`;
if (strstr($ARPTableLine, $_SERVER['REMOTE_ADDR']) !== FALSE)
{
$ARPArray = preg_split('/ +/',$ARPTableLine);
$retval = $ARPArray[2];
}
return $retval;
}
$mac = GetMACAddress();
if ($mac !== FALSE)
{
print $mac;
}
else
{
print 'not in ARP';
}
<?
function GetMACAddress()
{
$retval = FALSE;
//changed
$command = 'arp -a '.$_SERVER['REMOTE_ADDR'];
$ARPTableLine = `$command`;
if (strstr($ARPTableLine, $_SERVER['REMOTE_ADDR']) !== FALSE)
{
$ARPArray = preg_split('/ +/',$ARPTableLine);
//changed
return $ARPArray[10];
}
return $retval;
}
$mac = GetMACAddress();
if ($mac !== FALSE)
{
print $mac;
}
else
{
print 'not in ARP';
}
?>