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
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)]
a more comprehensive set of PHP tutorials , basic video and some small combat projects, below is the video directoryCD-ROM (i) \php employment Class (I.)CD-ROM (i) \php Technical exchange zone. URLCD-ROM (i) \ "Wisdom Special issue" belongs to it
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
This article illustrates the method of PHP querying IP location. Share to everyone for your reference.
The implementation methods are as follows:
Copy Code code as follows:
/**
*@ Date 2010.12.21
Note: file header [offset of first
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
Php uses the Baidu Map API for IP location and GPS location. Recently, a mobile-side webapp map application is developed, and the core content is Positioning. However, there are several methods for locating IP addresses, GPS positioning and base
PHP queries the ip address location (province, city ). This article introduces how to use relevant api interfaces to obtain a php instance in the city based on the client IP address. let's take a look at it. Today, we will share a PHP client IP
Php determines the source code of the IP address. The following code judges the user's city based on the IP address, php judges that the IP address location source code is completely open. the following code calls us to determine the user based on
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.