how to get the online user's MAC address using PHP?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
nmb
Forum Newbie
Posts: 21
Joined: Thu Jul 20, 2006 11:08 am

how to get the online user's MAC address using PHP?

Post by nmb »

hi pp!

how to get the online user's MAC address using PHP??
is that possible?

tnks!
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

not possible
Last edited by John Cartwright on Wed Dec 06, 2006 10:18 am, edited 1 time in total.
nmb
Forum Newbie
Posts: 21
Joined: Thu Jul 20, 2006 11:08 am

Post by nmb »

hum ok!

so how can it be made?
yckelvin
Forum Newbie
Posts: 1
Joined: Wed Dec 06, 2006 9:03 am

Re: how to get the online user's MAC address using PHP?

Post by yckelvin »

nmb wrote:hi pp!

how to get the online user's MAC address using PHP??
is that possible?

tnks!
First, php is server-based scripting but not client-based, so it can't work
nmb
Forum Newbie
Posts: 21
Joined: Thu Jul 20, 2006 11:08 am

Post by nmb »

yes that's right.

but the same we can get IP ADDRESS using $_SERVER['REMOTE_ADDR'],
i thought that I would give MAC ADDRESS by the same way.

mabye using javascript i can get the MAC ADDRESS.

I was only searching in php programming.. mabye the right place to search is javascript programming

tnks! ;)[/quote]
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Post by pickle »

The MAC address isn't passed in an HTTP request. The only way I've found it possible is if your server is also the DHCP server for the user. You can then look in the dhcpd.leases file for the MAC address. Other than that - you're out of luck.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Javascript cannot pull the MAC address either. It's just not available.
Post Reply