English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I want to make php page that make restriction that no one can use this page except from specific place(warehouse) so i want to get the mac address of the computer in the warehouse to compare it with the mac address of the client computers if it equal allow him to access this page , else prevent him , does any one can tell me how to get the mac address using php or javascript to do this task , also if there any idea to achieve this task without mac adrees?

2007-02-25 19:50:38 · 10 answers · asked by wael_kabil 1 in Computers & Internet Programming & Design

10 answers

and who will update the table of mac addresses each time a new machine is purchased???

you're better off checking to see if the ip address is in the correct subnet.

and the best security is password based... any clown can fake a mac address with just about any home router!

because of mac address cloning , there is no reliable way to get a mac address via the web!

Your network people can restrict the subnet to only those mac addresses they know... it's not a web guy's job.

if you are really into mac addresses add that to some real security!

2007-02-26 06:27:35 · answer #1 · answered by jake cigar™ is retired 7 · 0 0

Php Get Mac Address

2016-11-10 20:28:30 · answer #2 · answered by ? 4 · 0 0

I think this is not possible using JavaScript as it was not designed for such things. And if somehow you are able to do this using JavaScript, it will only work in IE using some ActiveX Objects and not in other browsers.
But I have found following PHP code. I have not tried this, but I think, you may get help from this.

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`;
$location = rtrim($location);

// Execute the arp command and store the output in $arpTable
$arpTable = `$location -n`;

// Split the output so every line is an entry of the $arpSplitted
//array $arpSplitted = split("\n",$arpTable);
$arpSplitted = split("\n",$arpTable);

// Get the remote ip address (the ip address of the client, the browser)
$remoteIp = $GLOBALS['REMOTE_ADDR'];
$remoteIp = str_replace(".", "\\.", $remoteIp);

// 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;
}
?>

2007-02-28 22:26:23 · answer #3 · answered by Atif Majid 3 · 1 0

PHP does not contain any built-in methods to acquire the MAC address of a connecting machine.

This file may give you something you can work with though:
http://phpclasses.promoxy.com/browse/file/7704.html
Although this relies on external Windows utilities so your web server must be a Windows server I believe.

Otherwise you might be able to code something in Python, but that will probably also be a Windows-specific solution.

Javascript definitely doesn't have anything like this.

I recommend NOT attempting to use this method of authentication because it is really inflexible. It would be better to use the IP address and Hostname as a basic auth method, then use an additional username/password auth method to keep your site private.

2007-02-25 19:59:41 · answer #4 · answered by wa-webguy 3 · 0 0

mac address client computer php javascript

2016-02-01 01:40:40 · answer #5 · answered by ? 4 · 0 0

The only MAC addresses your server will EVER see is the ones on the same network segment.

If someone access you server from the internet (meaning you have a router in between) the MAC address you'll see is your router's...

2007-02-28 06:12:39 · answer #6 · answered by m.trojahn 1 · 0 0

Oui c'est correct

2014-02-10 01:58:42 · answer #7 · answered by SAKKAL Abdelilah 1 · 0 0

I Use picasaweb its free easy to use and safe.

2016-03-16 01:03:30 · answer #8 · answered by ? 3 · 0 0

Try this code:









name="Button1" language="javascript" onclick="return Button1_onclick()">



Not certain if this is what you want but it might work.

2007-02-25 20:28:38 · answer #9 · answered by codereaper 3 · 0 1

fedest.com, questions and answers