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
list is as follows:
estimate
actual
ip geolocation service
1 hour to learn how to use service 1 hour to prepare database 1 hour to implement a fast algorithm for database lookup
fast, WCF Service is easy to learn half a hour for a binary search in database
Silverlight
0.5 hour to re-use buttons and map control
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.
*
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
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.