Suchy Posted June 22, 2011 Share Posted June 22, 2011 I have a people rating site and once in a while I get an email either from the cops or lawyers asking for ip address and MAC address of a someone who wrote an inappropriate comment. Collecting the ip address is no problem, but is it possible to get the mac address via php? I been searching for this and so far no luck. Quote Link to comment https://forums.phpfreaks.com/topic/240059-getting-a-mac-address-with-php/ Share on other sites More sharing options...
Pikachu2000 Posted June 22, 2011 Share Posted June 22, 2011 You can't get a mac address of a client machine. It isn't sent with the request unless it's on the same subnet. If the request traverses any layer 3 device (such as a router on the internet) the only mac address you'll have even a remote chance of obtaining is that of the last device to forward the packets to your server, which will be the same for all packets received from the outside. Quote Link to comment https://forums.phpfreaks.com/topic/240059-getting-a-mac-address-with-php/#findComment-1233135 Share on other sites More sharing options...
gizmola Posted June 22, 2011 Share Posted June 22, 2011 To add to Pika's answer, MAC addresses and TCP operate at entirely different OSI layers. In general, the higher the level, the more abstract. HTTP is built upon TCP which is layer 4. To be dogmatic about it, HTTP at layer 7 makes absolutely no provision for even IP. The reason you have access to IP addresses at all in php is because they come from the old cgi specification, and are provided by the http server itself which implements the socket server. There is no place in HTTP where even the IP address is part of the specification. Ethernet where the MAC address comes into play is layer 1. There is no reason for IP and certainly not TCP to be concerned with MAC addresses -- they need to be entirely transparent. If things weren't transparent, different network technologies would not be able to interoperate. One of the fundamental concepts enabling the internet, is that of routing, where you are able to send a packet to a destination IP from your network, without any real idea how the packet is going to get to the destination, since routers are able to delegate an understanding of where the packets need to go next, to other routers which advertise routes. People requesting a Mac address from you as a website owner, truly don't know what they are talking about. Quote Link to comment https://forums.phpfreaks.com/topic/240059-getting-a-mac-address-with-php/#findComment-1233163 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.