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";