1

i saw this simple code which echo's a MAC address but only on the server side, is it possible to get the page visitor's MAC address with these?

<?php
ob_start();
system('ipconfig /all');
$mycom=ob_get_contents();
ob_clean();
$findme = "Physical";
$pmac = strpos($mycom, $findme);
$mac=substr($mycom,($pmac+36),17);
echo 'Your MAC is '.$mac;
?>
CudoX
  • 915
  • 2
  • 18
  • 29
  • 7
    No; it isn't possible. – h2ooooooo Apr 16 '14 at 13:33
  • 1
    Unless you want to do some networking vodoo in your LAN, load balancing, or network requests on other layers than the IP OSI layer you don't need the MAC address. In times of secret agencies and ad companies gathering data and making profiles of those, the responsible mind's trend is going off of saving and working with this kind of data. If not in your LAN, the data is far off from being reliable either. – Daniel W. Apr 16 '14 at 13:39
  • If you need some unique user id, best bet might be to generate one and store in a cookie. This is not safe of course! – ToBe Apr 16 '14 at 13:42

0 Answers0