Created
September 14, 2014 17:33
-
-
Save kheniparth/d3f76ff4f6d2016117f1 to your computer and use it in GitHub Desktop.
How to find MAC address of your visitor using PHP
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 $mac; | |
?> |
It only works as long as the data packet hasn't been passed on by the router, so it only works when your visitor is on the same network. Once the data is sent out, the MAC address in the data packets changes to that of the passing node and that continuously repeats as the packets hop through the internet. There is no way to recover the MAC address of the original host.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It works on local server not on online server. Then what to do??
please help...