In Web applications, locating and logging related access logs based on IP addresses is also a common requirement, and in thinkphp you can easily implement IP address acquisition and positioning
You can download the IP Location Extension class
You can download the IP Location Extension class library at the http://www.thinkphp.cn/extend/223.html website, or download the extension package (http://www.thinkphp.cn/down/253.html) inside the extended class. If the Upload class library is
DAT files, information files about IP-corresponding areas
Qqwry.dat file
Download yourself Online
class file, parsing the Qqwry.data file's
iplocation.php File
Copy Code code as follows:
Class Iplocation {
/**
* @var Resource pointer
in Web applications, it is also a common requirement to locate and record related access logs based on IP addresses, and you can easily implement IP address acquisition and location in thinkphp You can download the IP Location Extension class
Based on the thinkphp, the application of the geographical location and the corresponding weather information according to the user IP
We all know that in a lot of sites provide users with the ability to provide weather forecasts, and sometimes
Based on thinkphp, you can determine the geographical location based on your ip address and provide the corresponding weather information. Thinkphp-based applications that determine geographical locations based on users' ip addresses and provide
PHP Query method for IP location
The implementation method is as follows:
The code is as follows:
/**
*@ Date 2010.12.21
Note: file header [offset of first index (4byte)] + [offset address of last index (4byte)] 8 bytes
Record area [end IP (4byte)]
In a recently completed module, you need to get the system client's IP地址 and 物理地址(MAC地址) .1. Gets the native IP and Mac is the server, not the client's →_→Through Java, the IP address and MAC address of this machine can be completed using the
Php queries the ip address location. The php method for querying the ip address location is as follows :? Php *** @ date2010.12.21 Note: [offset of the first index (4 byte)] + [offset of the last index php method for querying the ip address location
API Home: Http://lbsyun.baidu.com/index.php?title=webapi/high-acc-ip1. Apply for Baidu account, create application, get key (AK)Http://lbsyun.baidu.com/apiconsole/keyEnable the service :, can be based on their own needs to hook-and-choose, here
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.