求PHP 网站获取客户端MAC地址的方案
现在有个PHP网站,想获得访问客户的MAC地址,哪位大拿有什么好的解决方案,请告诉小弟,谢谢了。
回复讨论(解决方案)
………………
这个是不可能的。
你所能获取到的只能是客户端的IP地址、浏览器信息。
MAC地址肯定获取不到,除非你让客户端安控件……
无此方案
这个的确没有办法
除非执行段bat或者shell脚本获取
用exec 执行命令 试试
让用户自己输入,这是目前最好的办法
你要有方法了,记得贴出来哦
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');
这window XP可以,我已经做了测试.在我的机子上面可以..我觉得已改window 都可以,只是temp文件的位置可能不一样
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');
在我的机子上面可以,估计window都可以,只是要改哈temp文件的位置.
define ('EXEC_TMP_DIR', 'C:\WINDOWS\Temp');
function windExec($cmd,$mode=''){
$cmdline = "cmd /C $cmd";
if ($mode=='FG'){
$outputfile = EXEC_TMP_DIR."\\".time() . ".txt";
……
... ...
基础概念
php是运行于服务器端的.
引用 9 楼 的回复:
define ('EXEC_TMP_DIR', 'C:\WINDOWS\Temp');
function windExec($cmd,$mode=''){
$cmdline = "cmd /C $cmd";
if ($mode=='FG'){
$outputfile = EXEC_TMP_DIR."\\".time() . ".txt";
……
…… 这个的确只能在服务端.客户端必须要控件
一个方案是 自己实现个服务器的的模块 和一个php模块获取mac
按时按照原理 php一般是cgi fastcgi或者module
所以这个得服务器来做(iis apache 或者ngnix等)
然后这个数据得传给php
所以还得做个php模块接收和处理这个
貌似不简单啊
这个真的很难哦
不知道千方百计的获取 MAC 有什么用处?
须知 MAC 是不能跨网的,即只要穿过路由器就无效了
js调用wmi可以获取mac
可以这样~_~
不知道千方百计的获取 MAC 有什么用处?
须知 MAC 是不能跨网的,即只要穿过路由器就无效了
而且MAC地址也是可以改来改去的...
不知道楼主想干嘛?获得了mac难道比获取ip有用吗?
客户端获取主动上传,别无他法。
同意楼上,
之前有人说用IE控件可以
之前有人说用IE控件可以
现在还有什么人去装"获取MAC地址给我"控件?
做一个这个还不如开发个客户端呢,集成浏览器的功能。
@exec("ipconfig /all",$array);
for($Tmpa;$Tmpa
$mac=explode(":",$array[$Tmpa]);
echo $mac[1];
}
}
http://www.php100.com/html/webkaifa/PHP/PHPyingyong/2011/0904/9000.html
我用这个获取到了
http://www.php100.com/html/webkaifa/PHP/PHPyingyong/2011/0904/9000.html
我用这个获取到了
这个不可行 只能获取服务器端的客户端的不行

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



Alipay PHP...

JWT is an open standard based on JSON, used to securely transmit information between parties, mainly for identity authentication and information exchange. 1. JWT consists of three parts: Header, Payload and Signature. 2. The working principle of JWT includes three steps: generating JWT, verifying JWT and parsing Payload. 3. When using JWT for authentication in PHP, JWT can be generated and verified, and user role and permission information can be included in advanced usage. 4. Common errors include signature verification failure, token expiration, and payload oversized. Debugging skills include using debugging tools and logging. 5. Performance optimization and best practices include using appropriate signature algorithms, setting validity periods reasonably,

Article discusses late static binding (LSB) in PHP, introduced in PHP 5.3, allowing runtime resolution of static method calls for more flexible inheritance.Main issue: LSB vs. traditional polymorphism; LSB's practical applications and potential perfo

Session hijacking can be achieved through the following steps: 1. Obtain the session ID, 2. Use the session ID, 3. Keep the session active. The methods to prevent session hijacking in PHP include: 1. Use the session_regenerate_id() function to regenerate the session ID, 2. Store session data through the database, 3. Ensure that all session data is transmitted through HTTPS.

The application of SOLID principle in PHP development includes: 1. Single responsibility principle (SRP): Each class is responsible for only one function. 2. Open and close principle (OCP): Changes are achieved through extension rather than modification. 3. Lisch's Substitution Principle (LSP): Subclasses can replace base classes without affecting program accuracy. 4. Interface isolation principle (ISP): Use fine-grained interfaces to avoid dependencies and unused methods. 5. Dependency inversion principle (DIP): High and low-level modules rely on abstraction and are implemented through dependency injection.

How to automatically set the permissions of unixsocket after the system restarts. Every time the system restarts, we need to execute the following command to modify the permissions of unixsocket: sudo...

How to debug CLI mode in PHPStorm? When developing with PHPStorm, sometimes we need to debug PHP in command line interface (CLI) mode...

Static binding (static::) implements late static binding (LSB) in PHP, allowing calling classes to be referenced in static contexts rather than defining classes. 1) The parsing process is performed at runtime, 2) Look up the call class in the inheritance relationship, 3) It may bring performance overhead.
