Request the PHP website to get the client MAC address of the motion

Source: Internet
Author: User
Tags php website
Solution for obtaining client MAC address for PHP website
Now there is a PHP website, want to get access to the customer's MAC address, which Danale have any good solution, please tell my brother, thank you.

------Solution--------------------
..................

This is impossible.

All you can get is the client's IP address, browser information.

The MAC address is definitely not available unless you make the client-side security control ...
------Solution--------------------
Unless the execution segment bat or shell script gets
------Solution--------------------
Execute the command with exec and try it.
------Solution--------------------
Let the user input, this is the best way
------Solution--------------------
You have to have a way, remember to post it!
------Solution--------------------
Define (' Exec_tmp_dir ', ' C:\WINDOWS\Temp ');

function Windexec ($cmd, $mode = ") {

$cmdline = "Cmd/c $cmd";
if ($mode = = ' FG ') {
$outputfile = Exec_tmp_dir. " \ \ ". Time (). ". txt";
$cmdline. = "> $outputfile";
$m = true;
}
else $m = false;


$WshShell = new COM ("Wscript.Shell");
$oExec = $WshShell->run ($cmdline, 0, $m);

if ($outputfile) {
$RETSTR = file_get_contents ($outputfile);
Unlink ($outputfile);
}
else $retStr = "";

return $retStr;

}

echo windexec (' Ipconfig/all ', ' FG ');

This window XP can, I have done the test. On top of my machine, I can. I think you can change the window, but the temp file may not be the same location
------Solution--------------------
Define (' Exec_tmp_dir ', ' C:\WINDOWS\Temp ');

function Windexec ($cmd, $mode = ") {

$cmdline = "Cmd/c $cmd";
if ($mode = = ' FG ') {
$outputfile = Exec_tmp_dir. " \ \ ". Time (). ". txt";
$cmdline. = "> $outputfile";
$m = true;
}
else $m = false;


$WshShell = new COM ("Wscript.Shell");
$oExec = $WshShell->run ($cmdline, 0, $m);

if ($outputfile) {
$RETSTR = file_get_contents ($outputfile);
Unlink ($outputfile);
}
else $retStr = "";

return $retStr;

}

echo windexec (' Ipconfig/all ', ' FG ');
On my machine can be, estimate window can be, just to change the location of the temp file.
------Solution--------------------
Explore

Define (' Exec_tmp_dir ', ' C:\WINDOWS\Temp ');

function Windexec ($cmd, $mode = ") {

$cmdline = "Cmd/c $cmd";
if ($mode = = ' FG ') {
$outputfile = Exec_tmp_dir. " \ \ ". Time (). ". txt";
......

------Solution--------------------
discuss

Reference:

Define (' Exec_tmp_dir ', ' C:\WINDOWS\Temp ');

function Windexec ($cmd, $mode = ") {

$cmdline = "Cmd/c $cmd";
if ($mode = = ' FG ') {
$outputfile = Exec_tmp_dir. " \ \ ". Time (). ". txt";
......
......

------Solution--------------------
One scenario is to implement the server's own module and a PHP module to get the Mac

On time according to principle PHP is generally CGI fastcgi or module

So this has to be done by the server (IIS Apache or Ngnix, etc.)
And then this data has to be passed to PHP
So we have to do a PHP module to receive and handle this


Looks like it's not easy.

------Solution--------------------
This is really hard.
------Solution--------------------
What is the use of getting a MAC without knowing how to do it?
It is important to know that Macs are not cross-web, that is, if you pass through a router

------Solution--------------------
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.