Page 1 of 1

HELP! HELP! detect visitor mac address

Posted: Thu Jan 07, 2010 9:52 pm
by kennedysee
How do i detect the visitor mac address when they visit the website?


<?php
function getMac(){
exec("ipconfig /all", $output);
foreach($output as $line){
if (preg_match("/(.*)Physical Address(.*)/", $line)){
$mac = $line;
$mac = str_replace("Physical Address. . . . . . . . . :","",$mac);
}
}
return $mac;
}

$mac = getMac();
$mac = trim($mac);
?>

Re: HELP! HELP! detect visitor mac address

Posted: Thu Jan 07, 2010 11:44 pm
by manohoo
I am afraid that what you are asking is impossible... unless the user is in the same private network as your server, in which case you can detect it by using a command line (arp...)

Anyway, may I ask why you need the MAC address? I read that there are techniques to change the MAC address...

Re: HELP! HELP! detect visitor mac address

Posted: Fri Jan 08, 2010 3:43 am
by Apollo
As told before...
kennedysee wrote:
Apollo wrote:
kennedysee wrote:Then in what other language can i retrieve for MAC address?
Note that the getMac() function above gets the mac address of the server, not the visitor :) (and only if the host is a windows machine)
how do i get the visitor mac address?
pickle wrote:You can't.
Really. You can't.

Re: HELP! HELP! detect visitor mac address

Posted: Fri Jan 08, 2010 3:14 pm
by pickle
Asking the same question won't get you a different answer. Don't double post.

Locked.