Re: Get Mac Address

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



M. Sokolewicz have you ever typed arp at a command line?
It may give you a local mac address, but it is normally used to show your arp cache.

Now if you are on the same physical segment as the requester than you can obtain to mac address from parsing the output and matching it to the requesting IP.

For example my machine is IP 192.168.0.10, and a client on my network (192.168.0.188) just hit my webserver. Shelling out "arp -a" shows me this (under windows):

Interface: 192.168.0.10 --- 0x2
 Internet Address      Physical Address      Type
 192.168.0.1           00-02-78-71-53-a8     dynamic
 192.168.0.188         00-50-8d-e7-5d-6b     dynamic

Now the trick is to match up _SERVER["REMOTE_ADDR"] with the correct line from the output, and voila this gives me the mac address of the client requesting from my server.

The problem you face is when the remote client is on a different physical segment, as such its impossible (or extremely difficult without additional technologies) to obtain their MAC address. As Ben said he was using a local intranet server I'm sure Rory Browne's post is completely valid, for request from his LAN.

Andrew

----- Original Message ----- From: "M. Sokolewicz" <tularis@xxxxxxx>
To: "Rory Browne" <rory.browne@xxxxxxxxx>
Cc: "Ben Sagal" <bmsagal@xxxxxxxxx>; <php-general@xxxxxxxxxxxxx>
Sent: Sunday, October 09, 2005 11:52 PM
Subject: Re:  Get Mac Address


That will give you the *local* mac address, not that of the user visiting your page. The problem is the fact that the mac address is not sent as part of the REQUEST. As such it's not possible for PHP to find out what it is. So, unfortunately, no. (Though it's a very common question on this list)

- tul

Rory Browne wrote:
On unix
man arp

on windows
arp/h
arp/help
arp/?

sorry for short and sweet resp, but I'm falling asleep.

On 10/9/05, Ben Sagal <bmsagal@xxxxxxxxx> wrote:

I have a local intranet server, running apache1.3+php4.  Is it
possible to get the mac address of computes which access on of my php
pages?

Ben

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux