Use GeoIP2 to analyze visitors' IP addresses to obtain geographical location information.
Link: http://blog.csdn.net/johnnycode/article/details/42028841
MaxMind GeoIP2 is widely used to identify locations and other features of Internet users, this includes customized content, fraud detection, advertising targeting, website traffic analysis, execution rules, geographic target positioning, geo-fencing, and di
Today, I am sharing a PHP app that obtains the location of the app based on the client IP address. I have been using this app for a long time and I feel that this interface is still stable. Although there are many similar items on the Internet, I think this is quite good. The core code can be implemented in only three lines. Although the function is not very powerful, we usually use it. The following code i
If you want to find the actual geographic location of an IP address on the Earth, you can use many online GeoIp lookup services (such as geoiptool.com ). Most of these online services are supported by a free GeoIP database such as MaxMind. When using these web-based services, there are also some different methods to query the GeoIP database, especially the Linux Command Line.
In this tutorial, I want to dem
This article describes how to use the Sina interface of php to query ip addresses to obtain geographical locations.
The code is as follows:
Function getIPLoc_sina ($ queryIP ){
$ Url = 'http: // int.dpool.sina.com.cn/iplookup/iplookup.php? Format = json ip = '. $ queryIP;
$ Ch = curl_init ($ url );
Curl_setopt ($ ch, CURLOPT_ENCODING, 'utf8 ');
Curl_setopt ($ ch, CURLOPT_TIMEOUT, 5 );
Curl_setopt
msg= "Please enter the IP or domain name you want to inquire about:"
Ip=inputbox (msg, "IP location search for thieves")
If IP = "" Then IP = "127.0.0.1"
url = "http://www.ip.cn/?q=" IP
Provides various official and user-released code examples. For code reference, you are welcome to learn about Sina's use of ip addresses to obtain the current geographical location (ip end, country, province, city, and carrier) the php interface is very powerful.
/*** Obtain geographic location information* $ Format:
Use the IP138 database to query the geographic location for the domain name or IP address.
#-*-CODING:GBK-*-import Urllib2import re try: while True: ipaddr = Raw_input ("Enter IP Or Domain Name:") if IPAddr = = "" or ipaddr = = ' exit ': Break else: url = "http://www.ip138.com/ips138.asp?ip=%saction=
We have implemented the coordinate positioning and front-end display, and the coordinate acquisition is generally only on the mobile device, for the PC terminal is difficult to get. But on the PC side, we can get the corresponding IP. After we get the IP, we're ready to go. The code is as follows:public class Baidumap {//Note(1). Use const to define the URL template for the API.(2). Baidu key self-applicati
Under Linux, if there is a delay in the network, we usually need to analyze our own network environment to the peer server.1 Example: Ping www.baidu.com 2 Traceroute www.baidu.comThrough analysis to determine what is probably the problem, but when we go to track an IP when we do not know the source, if every one to go to www.ip138.com on the efficiency is too slow, and very troublesome, so a very convenient software turned out (nali-0.2.tar.gz).Nal
Excuse me! There are ip geographic location web open source version download can display ip and domain name geographic location similar to this: http://ip.adminunion.com, http://geolite.maxmind.com/download/geoip/geoipnbsp;very complete. Excuse me! There is an open-source web version of
200.1.168.192
}
}
Summary:1, configuration Linuxip time, set ifcfg-eh0 on the line, this is the system level, in the graphical interface manually configured IP settings, is user-level, and reboot, the system will first load the system-level configuration2, in the analysis process to find the command is not:grep "ZHOUCF"-rl/rootand thefind/root-type f-name "*" | xargs grep "ZHOUCF"3, Know NetworkManager is how to store
Use php file_get_contents to obtain the IP address and obtain the geographic location. See the following code:Use file_get_contents and fopen to enable allow_url_fopen. Method: edit php. ini and set allow_url_fopen = On. When allow_url_fopen is disabled, neither fopen nor file_get_contents can open remote files.Example The code is as follows:Copy code Function get_ip_place (){$
How can I determine the IP address location? For example, if a Shanghai user logs on to our website, the domain name automatically jumps to Shanghai, such as the question, one website has two domain names, the primary domain name and the Shanghai domain name, how can a user in Shanghai automatically jump to the domain name in Shanghai by checking whether the user is located in Shanghai when using the primar
A few days ago to the Web site to add a resolution IP location of the function, on the Internet to see some blog, find a few procedures, but always feel that writing is not concise enough to feel very long-winded. The following procedure, the feeling is also concise, so the collation debugging, you can use, the program calls the "Tencent IP Sharing Program" provi
1. Based on IP access to the location of the user's ideas:Query the database by IP address, then extract the corresponding geographic information from the database
2. Download the Maxmind database download addresshttps://dev.maxmind.com/geoip/geoip2/geolite2/It has the binary format and CSV format, which can be downloaded first:
geolite2-city.mmdb.gz
geolite2-cou
When you access a static HTML file on an IIS Web site, such as a index.htm,iis response, a content-location file header is included. If IIS is improperly configured, the Content-location file header will contain the IP address content of the server, causing the leak of the intranet IP address information that is hidden
The major websites are provided according to the IP to obtain the user's geographical location information, here to Sina's interface as an exampleThe interface address is: http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=jsip=218.18.171.146Code:1 #regionGet locations based on IP2 ///Get IP Attribution3 /// 4 /// IP5
This article mainly shares the js method for locating the geographical location of the current City Based on the IP address on the PC end, which has good reference value. Let's take a look at the following code:
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.