Request PHP website to get client MAC address proposal

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--------------------
Citation:
define (' Exec_tmp_dir ', ' C:\WINDOWS\Temp ');

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

$cmdline = "Cmd/c $cmd";
  • 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.