How to get MAC address of client using PHP?

kim edgard picture kim edgard · Feb 22, 2011 · Viewed 105.1k times · Source

How can I get MAC Address using PHP or javascript...

Answer

Pointy picture Pointy · Feb 22, 2011

The MAC address (the low-level local network interface address) does not survive hops through IP routers. You can't find the client MAC address from a remote server.

In a local subnet, the MAC addresses are mapped to IP addresses through the ARP system. Interfaces on the local net know how to map IP addresses to MAC addresses. However, when your packets have been routed on the local subnet to (and through) the gateway out to the "real" Internet, the originating MAC address is lost. Simplistically, each subnet-to-subnet hop of your packets involve the same sort of IP-to-MAC mapping for local routing in each subnet.