Go Back   Web Server Hosting Forum by BODHost > Support > PHP Forum
 

Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 01-18-10, 08:14
BOD Member
 
Join Date: Jan 2010
Posts: 9
Question Is it possible to identify the MAC address of visitor?

Is it possible to identify the Mac address of visitor through a php code? I couldn't find a solution for it.
Reply With Quote
  #2 (permalink)  
Old 01-18-10, 11:15
BOD Member
 
Join Date: Dec 2009
Location: Newark
Posts: 59
Default

I dont think it is possible to get the MAC address of a visitor, as the connections are passed through firewalls and also there is a use of ISP's Router in establishing an internet connection. However you can make use of ActiveX control or Java scripts to run on the visitors machine and get the MAC Address

Also can I know why do you need to know the MAC Address of your visitors? I am asking this as I'm just curious to know about that
Reply With Quote
  #3 (permalink)  
Old 01-18-10, 11:35
BOD Member
 
Join Date: Oct 2009
Posts: 45
Default

Hey Jade.

I guess this is somewhat impossible as the communication over the Web is through the IP and that also the public IP, MAC Address is never exposed to the web.

I would suggest you to chill :dancing: , don't try to attempt this. One day you will find that you have lost all your visitors due to banned domain :eek: .
Reply With Quote
  #4 (permalink)  
Old 01-19-10, 03:18
BOD Member
 
Join Date: Dec 2009
Location: Australia
Posts: 86
Default

I don't think people visiting your site would be too pleased if you obtain their Media Access Control address.

It can also be spoofed as easily as an IP address.

At the end of the day. Why do you need it?

If you want to obtain the MAC from a device connected on your local network, then yes that is possible. Quite Easy.
Reply With Quote
  #5 (permalink)  
Old 01-19-10, 11:04
BOD Member
 
Join Date: Jan 2010
Posts: 9
Thumbs up Its ok

Quote:
Originally Posted by Thomas View Post
Also can I know why do you need to know the MAC Address of your visitors? I am asking this as I'm just curious to know about that
Hi Thomas

Actually I heard that data link layer bind mac address with frame for recognize to which device that frame handed over, after this I was interested to know the process of Identifying MAC address, but its ok nothing serious if I couldn't do it.
Reply With Quote
  #6 (permalink)  
Old 01-19-10, 11:07
BOD Member
 
Join Date: Jan 2010
Posts: 9
Default Thanks a lot

Quote:
Originally Posted by Fletcher View Post
Hey Jade.

I would suggest you to chill :dancing: , don't try to attempt this. One day you will find that you have lost all your visitors due to banned domain :eek: .
I am Thanx thankful to you for making me aware of this.
Reply With Quote
  #7 (permalink)  
Old 01-22-10, 09:27
BOD Member
 
Join Date: Dec 2009
Location: Newark
Posts: 59
Default

Quote:
Originally Posted by Jade View Post
Hi Thomas

Actually I heard that data link layer bind mac address with frame for recognize to which device that frame handed over, after this I was interested to know the process of Identifying MAC address, but its ok nothing serious if I couldn't do it.
Jade, I think that you have misunderstood the concept of getting the MAC address through a PHP script and the working of Data Link Layer

Actually the thing you are talking about in this post involves the functioning of the 2nd Layer - Data Link Layer. Data Link Layer is a part of the OSI Reference Model, which is a set of rules and regulations by the Open System Interconnections.
Reply With Quote
  #8 (permalink)  
Old 12-02-11, 12:47
BOD Member
 
Join Date: Dec 2011
Posts: 16
Default Mac addresss with php

hi,
Use the following script to get the mac address using php
<?php
/*
* Getting MAC Address using PHP
* Md. Nazmul Basher
*/

ob_start(); // Turn on output buffering
system(‘ipconfig /all’); //Execute external program to display output
$mycom=ob_get_contents(); // Capture the output into a variable
ob_clean(); // Clean (erase) the output buffer

$findme = “Physical”;
$pmac = strpos($mycom, $findme); // Find the position of Physical text
$mac=substr($mycom,($pmac+36),17); // Get Physical Address

echo $mac;
?>
Regards
CoreIT developers
Reply With Quote
  #9 (permalink)  
Old 12-08-11, 20:29
BOD Member
 
Join Date: Dec 2011
Posts: 2
Default Identify Mac address

Hi,


I think you can find the mac address from the given below function.

function returnMacAddress() {
// This code is under the GNU Public Licence
// Written by michael_stankiewicz {don't spam} at yahoo {no spam} dot com
// Tested only on linux, please report bugs

// WARNING: the commands 'which' and 'arp' should be executable
// by the apache user; on most linux boxes the default configuration
// should work fine

// Get the arp executable path
$location = `which arp`;
// Execute the arp command and store the output in $arpTable
$arpTable = `$location`;
// Split the output so every line is an entry of the $arpSplitted array
$arpSplitted = split("\n",$arpTable);
// Get the remote ip address (the ip address of the client, the browser)
$remoteIp = $GLOBALS['REMOTE_ADDR'];
// Cicle the array to find the match with the remote ip address
foreach ($arpSplitted as $value) {
// Split every arp line, this is done in case the format of the arp
// command output is a bit different than expected
$valueSplitted = split(" ",$value);
foreach ($valueSplitted as $spLine) {
if (preg_match("/$remoteIp/",$spLine)) {
$ipFound = true;
}
// The ip address has been found, now rescan all the string
// to get the mac address
if ($ipFound) {
// Rescan all the string, in case the mac address, in the string
// returned by arp, comes before the ip address
// (you know, Murphy's laws)
reset($valueSplitted);
foreach ($valueSplitted as $spLine) {
if (preg_match("/[0-9a-f][0-9a-f][:-]".
"[0-9a-f][0-9a-f][:-]".
"[0-9a-f][0-9a-f][:-]".
"[0-9a-f][0-9a-f][:-]".
"[0-9a-f][0-9a-f][:-]".
"[0-9a-f][0-9a-f]/i",$spLine)) {
return $spLine;
}
}
}
$ipFound = false;
}
}
return false;

Thanks
Rama Kant Singh
CoreIT Developer

Reply With Quote
  #10 (permalink)  
Old 12-10-11, 14:39
BOD Member
 
Join Date: Nov 2011
Posts: 1
Default q cheap viagra generic lowest pri

link topic
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump


All times are GMT -6. The time now is 02:20.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
Copyright © 1999-2012, BODHost Ltd. All rights reserved.