|
Re: How to get client mac address in PHP ..? [message #176041 is a reply to message #176040] |
Mon, 21 November 2011 11:36 |
The Natural Philosoph
Messages: 993 Registered: September 2010
Karma: 0
|
Senior Member |
|
|
rrvasanth wrote:
> Dear friends...
>
> I need to know the MAC address of the connect clients, how can I do
> this in PHP?
>
Try magic.
The only mac address the server sees is that of its upstream Ethernet*
router, at best.
MAC addresses are purely Ethernet*.
http://en.wikipedia.org/wiki/MAC_address
*strictly MAC addresses also apply to other things like token ring etc,
but who uses those these days?
Your only hope is to ask the browser to supply it in a cookie using
probably javascript or java, but I very much doubt the browser would
actually bn able to tell what it was.
And it would be trivial to fake it anyway.
Which makes the final point, which is that there is zero purpose in
having it at all in the first place.
In short you want an impossible solution to a problem that has no
purpose in the first place.
> Thanks
> Vasanth
|
|
|
Re: How to get client mac address in PHP ..? [message #176042 is a reply to message #176040] |
Mon, 21 November 2011 12:16 |
Jerry Stuckle
Messages: 2598 Registered: September 2010
Karma: 0
|
Senior Member |
|
|
On 11/21/2011 6:15 AM, rrvasanth wrote:
> Dear friends...
>
> I need to know the MAC address of the connect clients, how can I do
> this in PHP?
>
> Thanks
> Vasanth
Sorry, it's not possible. It's not sent to your server. All you have
available is the IP address. And it's possible the client may not even
have a MAC address, i.e. a dial-up client would have the MAC address of
the dial-up server (don't laugh - there are still a lot of these around
the world).
The real question is - what problem are you trying to solve?
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
|
|
|
Re: How to get client mac address in PHP ..? [message #176050 is a reply to message #176040] |
Mon, 21 November 2011 16:18 |
Denis McMahon
Messages: 634 Registered: September 2010
Karma: 0
|
Senior Member |
|
|
On Mon, 21 Nov 2011 03:15:12 -0800, rrvasanth wrote:
> I need to know the MAC address of the connect clients, how can I do
> this in PHP?
You need a course in ethernet protocols. Then you'll understand why
either (a) you can not need this information or (b) you have been given
an impossible coding (or homework?) assignment.
Rgds
Denis McMahon
|
|
|
Re: How to get client mac address in PHP ..? [message #176051 is a reply to message #176050] |
Mon, 21 November 2011 16:43 |
Thomas 'PointedEars'
Messages: 701 Registered: October 2010
Karma: 0
|
Senior Member |
|
|
Denis McMahon wrote:
> On Mon, 21 Nov 2011 03:15:12 -0800, rrvasanth wrote:
>> I need to know the MAC address of the connect clients, how can I do
>> this in PHP?
>
> You need a course in ethernet protocols.
You need to learn to spell "Ethernet" and understand what it is.
> Then you'll understand why either (a) you can not need this information
> or (b) you have been given an impossible coding (or homework?) assignment.
It is neither irrelevant nor impossible to obtain that information using
PHP. You would know that if you knew that MAC addresses do not require
Ethernet.
PointedEars
--
> If you get a bunch of authors […] that state the same "best practices"
> in any programming language, then you can bet who is wrong or right...
Not with javascript. Nonsense propagates like wildfire in this field.
-- Richard Cornford, comp.lang.javascript, 2011-11-14
|
|
|
Re: How to get client mac address in PHP ..? [message #176053 is a reply to message #176051] |
Mon, 21 November 2011 20:17 |
Doug Miller
Messages: 171 Registered: August 2011
Karma: 0
|
Senior Member |
|
|
On 11/21/2011 11:43 AM, Thomas 'PointedEars' Lahn wrote:
> Denis McMahon wrote:
>
>> On Mon, 21 Nov 2011 03:15:12 -0800, rrvasanth wrote:
>>> I need to know the MAC address of the connect clients, how can I do
>>> this in PHP?
>>
>> You need a course in ethernet protocols.
>
> You need to learn to spell "Ethernet" and understand what it is.
Oh, looky, a spelling fLame.
>
>> Then you'll understand why either (a) you can not need this information
>> or (b) you have been given an impossible coding (or homework?) assignment.
>
> It is neither irrelevant nor impossible to obtain that information using
> PHP. You would know that if you knew that MAC addresses do not require
> Ethernet.
>
LMAO. How do you propose that he can do that?
Hint: re-read the post above as many times as needed until you realize
that the OP wrote "MAC address" and not "IP address".
|
|
|
Re: How to get client mac address in PHP ..? [message #176054 is a reply to message #176053] |
Mon, 21 November 2011 21:54 |
Denis McMahon
Messages: 634 Registered: September 2010
Karma: 0
|
Senior Member |
|
|
On Mon, 21 Nov 2011 15:17:48 -0500, Doug Miller wrote:
> On 11/21/2011 11:43 AM, Thomas 'PointedEars' Lahn wrote:
>> Denis McMahon wrote:
>>
>>> On Mon, 21 Nov 2011 03:15:12 -0800, rrvasanth wrote:
>>>> I need to know the MAC address of the connect clients, how can I do
>>>> this in PHP?
>>>
>>> You need a course in ethernet protocols.
>>
>> You need to learn to spell "Ethernet" and understand what it is.
>
> Oh, looky, a spelling fLame.
>>
>>> Then you'll understand why either (a) you can not need this
>>> information or (b) you have been given an impossible coding (or
>>> homework?) assignment.
>>
>> It is neither irrelevant nor impossible to obtain that information
>> using PHP. You would know that if you knew that MAC addresses do not
>> require Ethernet.
>>
> LMAO. How do you propose that he can do that?
>
> Hint: re-read the post above as many times as needed until you realize
> that the OP wrote "MAC address" and not "IP address".
Actually, I would love to see TPEL code a web page that displayed the MAC
address of any computer that requested it. However, it's impossible for
him to do it! He does not have the ability to code such a page. He
couldn't even manage it for the satisfaction of proving me wrong!
I know that the only MAC address that appears on packets arriving at my
web server on my lan are those of my router (when a page is requested
from outside the lan), or other interfaces on the lan. Anything connected
over wireless to the wap presents the wap MAC address to the rest of the
lan.
Of course, if the OPs application is hosted on a server using some other
connection technology than ethernet, then my comments about ethernet
might not apply, but to the best of my knowledge, most servers operate on
ethernet connected hardware, and it's a fairly fundamental fact of
ethernet networking that ethernet MAC addresses do not generally travel
past media segment boundaries, such as routers and waps.
Rgds
Denis McMahon
psst Thomas, prove me wrong, code a web page that displays the MAC
address of the computer requesting the web page, and post the code to
prove you did it in php. Because I say you can't do it!
|
|
|
Re: How to get client mac address in PHP ..? [message #176055 is a reply to message #176054] |
Tue, 22 November 2011 00:20 |
Thomas 'PointedEars'
Messages: 701 Registered: October 2010
Karma: 0
|
Senior Member |
|
|
Denis McMahon wrote:
> On Mon, 21 Nov 2011 15:17:48 -0500, Doug Miller wrote:
>> On 11/21/2011 11:43 AM, Thomas 'PointedEars' Lahn wrote:
>>> Denis McMahon wrote:
>>>> On Mon, 21 Nov 2011 03:15:12 -0800, rrvasanth wrote:
>>>> > I need to know the MAC address of the connect clients, how can I do
>>>> > this in PHP?
>>>> […]
>>> It is neither irrelevant nor impossible to obtain that information
>>> using PHP. You would know that if you knew that MAC addresses do not
>>> require Ethernet.
> […]
> Actually, I would love to see TPEL code a web page that displayed the MAC
> address of any computer that requested it. However, it's impossible for
> him to do it!
"Any computer" and "web page" are ideas of yours that have nothing to do
with the original question.
> He does not have the ability to code such a page.
Nobody has, but only because you have raised the bar. A common fallacy, but
not an unexpected one coming from you.
> psst Thomas, prove me wrong, code a web page that displays the MAC
> address of the computer requesting the web page, and post the code to
> prove you did it in php. Because I say you can't do it!
Contrary to what you apparently imagine in your little idiot replacement of
a brain, I do not care to satisfy your every whim just to prove that you are
wrong. Hint: arp.
PointedEars
--
Danny Goodman's books are out of date and teach practices that are
positively harmful for cross-browser scripting.
-- Richard Cornford, cljs, <cife6q$253$1$8300dec7(at)news(dot)demon(dot)co(dot)uk> (2004)
|
|
|
Re: How to get client mac address in PHP ..? [message #176056 is a reply to message #176040] |
Tue, 22 November 2011 03:08 |
Centurion
Messages: 1 Registered: November 2011
Karma: 0
|
Junior Member |
|
|
On 2011-11-21 11:15:12 +0000, rrvasanth said:
> Dear friends...
>
> I need to know the MAC address of the connect clients, how can I do
> this in PHP?
>
> Thanks
> Vasanth
30 seconds on Google turned up this:
http://forums.devarticles.com/general-programming-help-4/how-can-i-find-out -the-user-mac-address-1846.html
Be aware, the connecting client's MAC (Ethernet) address will only be
available *IF* that client is on the same broadcast domain as your
PHP/Web server. If they are on a different broadcast domain, you get
nothing.
Broadcast domain is best thought of as LAN/VLAN. In short, the moment
the packet pops up to layer 3 (ie, router/layer 3 switch) between
server and client, you're boned.
Suggest you get a good book on the OSI model and read up on Ethernet,
IP and the layer 4 family (UDP/TCP/etc).
--
James
Let a fool hold his tongue and he will pass for a sage.
-- Publilius Syrus
|
|
|
Re: How to get client mac address in PHP ..? [message #176057 is a reply to message #176055] |
Tue, 22 November 2011 03:14 |
Jerry Stuckle
Messages: 2598 Registered: September 2010
Karma: 0
|
Senior Member |
|
|
On 11/21/2011 7:20 PM, Thomas 'PointedEars' Lahn wrote:
> Denis McMahon wrote:
>
<snip>
>
> Contrary to what you apparently imagine in your little idiot replacement of
> a brain, I do not care to satisfy your every whim just to prove that you are
> wrong. Hint: arp.
>
>
> PointedEars
IOW, you have no idea how to do it. But you said it could be done.
That's typical - all mouth and no brains.g
It's not your ears that are pointed! But it does reside on top of your
neck.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
|
|
|
Re: How to get client mac address in PHP ..? [message #176058 is a reply to message #176055] |
Tue, 22 November 2011 09:28 |
The Natural Philosoph
Messages: 993 Registered: September 2010
Karma: 0
|
Senior Member |
|
|
Thomas 'PointedEars' Lahn wrote:
> Denis McMahon wrote:
>
>> On Mon, 21 Nov 2011 15:17:48 -0500, Doug Miller wrote:
>>> On 11/21/2011 11:43 AM, Thomas 'PointedEars' Lahn wrote:
>>>> Denis McMahon wrote:
>>>> > On Mon, 21 Nov 2011 03:15:12 -0800, rrvasanth wrote:
>>>> >> I need to know the MAC address of the connect clients, how can I do
>>>> >> this in PHP?
>>>> > […]
>>>> It is neither irrelevant nor impossible to obtain that information
>>>> using PHP. You would know that if you knew that MAC addresses do not
>>>> require Ethernet.
>> […]
>> Actually, I would love to see TPEL code a web page that displayed the MAC
>> address of any computer that requested it. However, it's impossible for
>> him to do it!
>
> "Any computer" and "web page" are ideas of yours that have nothing to do
> with the original question.
>
>> He does not have the ability to code such a page.
>
> Nobody has, but only because you have raised the bar. A common fallacy, but
> not an unexpected one coming from you.
>
>> psst Thomas, prove me wrong, code a web page that displays the MAC
>> address of the computer requesting the web page, and post the code to
>> prove you did it in php. Because I say you can't do it!
>
> Contrary to what you apparently imagine in your little idiot replacement of
> a brain, I do not care to satisfy your every whim just to prove that you are
> wrong. Hint: arp.
>
>
which will reveal ONLY the nodes on the LOCAL directly connected
network. In the case of many hosted servers, that will be an upstream
router ONLY
Once past a router, the MAC dress is lost.
Hint: that's why we don't run the internet using MAC addresses for wide
area routing.
..
> PointedEars
|
|
|
Re: How to get client mac address in PHP ..? [message #176070 is a reply to message #176058] |
Tue, 22 November 2011 12:38 |
Thomas 'PointedEars'
Messages: 701 Registered: October 2010
Karma: 0
|
Senior Member |
|
|
The Natural Philosopher wrote:
> Thomas 'PointedEars' Lahn wrote:
>> Denis McMahon wrote:
>>> On Mon, 21 Nov 2011 15:17:48 -0500, Doug Miller wrote:
>>>> On 11/21/2011 11:43 AM, Thomas 'PointedEars' Lahn wrote:
>>>> > Denis McMahon wrote:
>>>> >> On Mon, 21 Nov 2011 03:15:12 -0800, rrvasanth wrote:
>>>> >>> I need to know the MAC address of the connect clients, how can I do
>>>> >>> this in PHP?
>>>> >> […]
>>>> > It is neither irrelevant nor impossible to obtain that information
>>>> > using PHP. You would know that if you knew that MAC addresses do not
>>>> > require Ethernet.
>>> […]
>>> Actually, I would love to see TPEL code a web page that displayed the
>>> MAC address of any computer that requested it. However, it's impossible
>>> for him to do it!
>>
>> "Any computer" and "web page" are ideas of yours that have nothing to do
>> with the original question.
>>
>>> He does not have the ability to code such a page.
>>
>> Nobody has, but only because you have raised the bar. A common fallacy,
>> but not an unexpected one coming from you.
>> […]
>> Hint: arp.
>
> which will reveal ONLY the nodes on the LOCAL directly connected
> network. In the case of many hosted servers, that will be an upstream
> router ONLY
>
> Once past a router, the MAC dress is lost.
>
> Hint: that's why we don't run the internet using MAC addresses for wide
> area routing.
> .
It is good to see that at least one person got the meaning of my posting.
There is hope for you yet.
PointedEars
--
Prototype.js was written by people who don't know javascript for people
who don't know javascript. People who don't know javascript are not
the best source of advice on designing systems that use javascript.
-- Richard Cornford, cljs, <f806at$ail$1$8300dec7(at)news(dot)demon(dot)co(dot)uk>
|
|
|