|
Posted by "Andrew Brampton" on 10/10/05 02:06
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@php.net>
To: "Rory Browne" <rory.browne@gmail.com>
Cc: "Ben Sagal" <bmsagal@gmail.com>; <php-general@lists.php.net>
Sent: Sunday, October 09, 2005 11:52 PM
Subject: Re: [PHP] 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@gmail.com> 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
>
>
Navigation:
[Reply to this message]
|