Get IP and geolocation class sharing in PHP, IP geolocation
Before we found a script that didn't finish, it simply expanded.Getting IP is using classic logic, and geo-targeting uses the generic interface of Sina.
The use of the method see source code:
Copy CodeThe code is a
IP geolocation Query class
/**
File name: IpLocation.class.php
* IP Geo-Location query class (Master file I'm uploading it.) I upload a test file, and there is a QQWry.Dat this can be downloaded to the pure IP library because there are more than 6M so here do not upload it up.
*
Due to historical Internet reasons, apin is responsible for the overall planning of the entire network IP address and IP allocation management in some African regions in North America. Correspondingly, whois.apin.net is the root server of IP whois, the standard IP
Overview
This report summarizes a pair of programming projects. I (Lin Meng) and Li yazhao jointly completed this project.
The goal of the project is to obtain the geographical location information of the user through the user's IP address when the user accesses the academic map, so as to reposition the map and set the location of the user as the center currently displayed. This function is available on many network maps, such as Bing map and Googl
Due to the historical reasons for the Internet, Apin is responsible for the overall network IP planning as well as the North American region also has some of Africa's IP allocation management, and accordingly, whois.apin.net is the IP whois root server, the standard IP
A gadget that displays IP geolocation information under Linux-naliFirst, IntroductionNali, the name is taken from the Chinese "where" pinyin. Nali contains a set of command-line programs whose main function is to attach the IP strings of the output of some network tools to the location information (using the Pure database QQWry.Dat). For example, 74.125.128.104 w
#./configure# Make make installIv. Updating IP databasesYou can use the Nali-update command to update the IP database/usr/local/share/qqwry.dat This file needs to be updated frequently, otherwise the error will be relatively large.V. Use of5.1. Nali# Nali 74.125.128.106# Nali 61.135.169.1055.2. Nali-dig# Nali-dig www.google.com5.3. Nali-nslookup# nali-nslookup www.google.com5.4. Nali-traceroute# Nali-trace
#./configure# Make make installIv. Updating IP databasesYou can use the Nali-update command to update the IP database/usr/local/share/qqwry.dat This file needs to be updated frequently, otherwise the error will be relatively large.V. Use of5.1. Nali# Nali 74.125.128.106# Nali 61.135.169.1055.2. Nali-dig# Nali-dig www.google.com5.3. Nali-nslookup# nali-nslookup www.google.com5.4. Nali-traceroute# Nali-trace
"title=" 10.jpg "alt=" Wkiom1vvtavisvxeaamv_hollcq887.jpg "/>In other words, Nali This command, you can attach the geo-information to the standard output IP. Similarly, if you do not like to use Nali-dig, then you can also use dig Ip|nali such commands.VI. AliasIf you think the input nali-xxx trouble, then you can do some alias, for example:# alias Traceroute= ' Nali-traceroute '# alias dig= ' Nali-dig '65
to dig |nali)Second, download# wget--no-check-certificate http://qqwry.googlecode.com/files/nali-0.2.tar.gzThird, installation# tar ZXVF nali-0.2.tar.gz# CD nali-0.2#./configure# Make make installIv. Updating IP databasesYou can use the Nali-update command to update the IP database/usr/local/share/qqwry.dat This file needs to be updated frequently, otherwise the error will be relatively large.V. Use of5.1
[To] How is the IP address of the carrier assigned by WHOIS?The IP address distribution of some Chinese telecom operators is obtained under Linux:Apnic is the organization of IP address allocation in the Asia-Pacific region, it has a rich and accurate IP address allocation d
Due to the historical reasons for the Internet, Apin is responsible for the overall network IP planning as well as the North American region also has some of Africa's IP allocation management, and accordingly, whois.apin.net is the IP whois root server, the standard IP
In operation and maintenance work, sometimes need to query some domain name registration information (domain name NS, registered users, registered mailbox, etc.), you can use the WHOIS command.The WHOIS command is used to find and display user-related information for a specified account (or domain name), because it is located in the WHOIS database of network solu
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.