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);
?>
HELP! HELP! detect visitor mac address
Moderator: General Moderators
-
kennedysee
- Forum Newbie
- Posts: 14
- Joined: Fri Dec 04, 2009 12:17 am
Re: HELP! HELP! detect visitor mac address
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...
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
As told before...
kennedysee wrote:how do i get the visitor mac address?Apollo wrote:Note that the getMac() function above gets the mac address of the server, not the visitorkennedysee wrote:Then in what other language can i retrieve for MAC address?(and only if the host is a windows machine)
Really. You can't.pickle wrote:You can't.
Re: HELP! HELP! detect visitor mac address
Asking the same question won't get you a different answer. Don't double post.
Locked.
Locked.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.