Php fails to get the MAC address and IP address of the client. js code embedding solution
Source: Internet
Author: User
Php fails to get the MAC address and IP address of the client. js code embedded through various Baidu and various searches. it is concluded that the php code can only get the mac address of the server and cannot get the mac address of the client, the ip address can only obtain the client's Internet ip address, but cannot obtain the actual intranet ip address (192.168.1. * **) I switched to the js method and copied the programs found on the internet. php failed to get the MAC and IP address of the client. js code embedding failed.
After a variety of Baidu and various searches, it is concluded that the php code can only obtain the server mac, cannot obtain the client mac, and can only obtain the client Internet ip address, cannot obtain the actual intranet ip address (192.168.1. ***)
So I switched to the js method and copied the programs found on the internet. it seems that everyone uses the following methods, but there are two fatal problems.
1. generate an html file and run it directly to obtain the mac address and IP address. However, you can only run the activex control in the IE browser and get the user's permission to run it. Google, firefox, and safari cannot respond at all.
2. if you embed the js code in php, it will not work. The local localhost test always reports an error (unidentifiable, *** is empty) and uploading to the server will certainly not work.
It is a headache. The first problem cannot be solved. The second problem may be my own reason. have you successfully debugged it with localhost on the php page?
WMI Scripting HTML
For = "foo">
Document.forms000002.16.txt MACAddr. value = unescape (MACAddr );
Document.forms000002.16.txt IPAddr. value = unescape (IPAddr );
Document.forms000002.16.txt DNSName. value = unescape (sDNSName );
// Document. formbar. submit ();
Script
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