Go from blog: Baidu Map API IP location city and browser location http://blog.csdn.net/suixufeng/article/details/13511761Baidu Maps API provides geolocation and localcity two service classes.These APIs can be used by the user to locate and verify the city in JavaScript, respectively.1 in essence, the Geolocation class is positioned using the geolocation
Tencent IP Address query interface: http://fw.qq.com/ipaddress
Sina IP Address query interface: HTTP://INT.DPOOL.SINA.COM.CN/IPLOOKUP/IPLOOKUP.PHP?FORMAT=JS
Sohu IP Address query interface: Http://pv.sohu.com/cityjson
Google IP address query interface: http://j.maxmind.com/app/geoip.js
Youdao
Function:
1, gets the current IP address,
2, call Sina API, get to the current city.
3, convert Chinese to pinyin after jump.
Copy the Code code as follows:
Include './pinyin.php ';
Get current IPfunction GetIP () {$onlineip = ";if (getenv (' http_client_ip ') strcasecmp (getenv (' http_client_ip '), ' unknown ') {$onlineip =getenv (' http_client_ip ');} elseif (getenv (' http_x_forwarded_for ') strcas
API code for phpcurl to obtain all information of a specified IP address
This article describes how to use the curl function in php to obtain the API code of all information under the specified IP address. For more information, see.Share The api code that uses curl
The main API getnetworkparams () and getadaptersinfo () functions enumerate all network adapters in windows, print the IP, gateway, and Mac, and convert the MAC address from hex to string.
/*Add to projectIphlpapi. LibFile*/
# Include # Include # Include # Include
Void _ fastcall enumadapterinfo (){// Obtain the address of the local network device
DWORD err;
Pfixed_info pfixedinfo;DWORD fixedinfosize = 0;
Function:1. Get the current IP address,2. Call Sina API to obtain the current city.3. Convert Chinese to Pinyin and then jump.
Copy codeThe Code is as follows:Include './pinyin. php ';
// Obtain the current ip AddressFunction getIp (){$ Onlineip = '';If (getenv ('HTTP _ CLIENT_IP ') strcasecmp (getenv ('HTTP _ CLIENT_IP'), 'unknown ')){$ Onlineip = getenv ('HTTP
array of 5 elements: IP address, State, provincial and municipal, affiliated units, service providers
Youdao: HTTP://WWW.YOUDAO.COM/SMARTRESULT-XML/SEARCH.S
Query IP parameters:? type=qip=119.75.217.56
Back to data: 119.75.217.56 Beijing Baidu Company
Query phone number parameters:? type=mobileq=13387617842
Back to data: 13387617842 Wuhan, Hubei
Or: http://www.youdao.com/smartresult-xml/search.s?jsFl
This article describes how to call Sina api based on ip addresses to obtain city names and convert them to pinyin. For more information, see the following functions:
1. get the current IP address,
2. call Sina API to obtain the current city.
3. convert Chinese to pinyin and then jump.
The code is as follows:
Includ
IP interface API query
IP interface queryHttp://api.apidatas.com/ip/docInterface DescriptionThe IP address location is called. this interface is not pure data and is not comparable to any other data on the market, but... it cannot be completely 100% accurate !!! Unl
This article introduces, using the Curl function in PHP to obtain the specified IP address all the information under the API code, the need for a friend reference.Share the API code that uses curl to get all the information under the specified IP. For curl related content, you can refer to the following articles: A sim
Function:1, get the current IP address,2, call the Sina API to get to the current city.3, convert the Chinese to pinyin and then jump.
Copy Code code as follows:
Include './pinyin.php ';
Get current IPfunction GetIP () {$onlineip = ';if (getenv (' http_client_ip ') strcasecmp (getenv (' http_client_ip '), ' unknown ')) {$onlineip =getenv (' http_client_ip ');} elseif (getenv (' http_x_forwa
Tencent's IP Address API interface address: http://fw.qq.com/ipaddress
The data format returned is:
1 var ipdata = new Array ("58.218.198.205″," "", "Jiangsu province", "Xuzhou");
Use JS code to make a fetch:
1 2
Sina's IP address query interface: HTTP://INT.DPOOL.SINA.COM.CN/IPLOOKUP/IPLOOKUP.PHP?FORMAT=JS
Sina Multi-Region test method: http://int.dpool
Tencent IP address query interface: http://fw.qq.com/ipaddressSina IP address query interface: http://int.dpool.sina.com.cn/iplookup/iplookup.php? Format = jsSohu IP address query interface: http://pv.sohu.com/cityjsonGoogle IP address query interface: http://j.maxmind.com/app/geoip.jsYoudao
1.
CD geoip/
wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz
gzip-d GeoIP.dat.gz
ls
GeoLiteCity.dat
Other libraries: viewing
http://dev.maxmind.com/zh-hans/geoip/legacy/geolite/
2.
wget http://www.maxmind.com/download/geoip/api/php/php-latest.tar.gz
Unzip php-latest.tar.gz
3. Use
Include ("/www/web/develop/marketsystem/common/lib/geoip-api-php-1.14/src/geo
correctly when transferring between different hosts. The network byte order takes the big endian sort method.In order to convert the BSD socket provides a function of conversion, there are four network and host byte conversion functions: Htons ntohs htonl Ntohl (S is short L is long H is host n is network)Htons the unsigned short type from the host to the network sequence, htonl the unsigned long type from the host to the network sequence, ntohs the unsigned short type from the network sequence
The main added 1 Selectinterfaces records, the essence is that the database is the join this table. The Perl code is as follows:#!/usr/bin/perl UseStrict; Usewarnings; UseJSON::RPC::Client; UseData::dumper; UseJSON; UseUTF8; UseParallel::Forkmanager;my $pm= Parallel::forkmanager->new ( -); #define the number of open processes$| =1;Binmode(STDIN,': Encoding (UTF8)' );Binmode(STDOUT,': Encoding (UTF8)' ); #Three rowsBinmode(STDERR,': Encoding (UTF8)' ); #for normal output Chinese # Authenticate yo
Youdao search and IP138 ip api (PHP application ). Copy the code as follows :? Php $ myip $ _ SERVER [REMOTE_ADDR]; ip138wap. ip138.comip. asp? Ipwww. myolnet. comyoudaowww. You Dao. comsmartresult-xmlsearch.s? Type
The code is as follows:
$ Myip = $ _ SERVER ["REMOTE_ADDR"];/Ip138 http://wap.ip138.com/ip.asp? Ip = www.myolnet.com// Youdao http://www.youdao.
customer connections. As long as you do not accept, the number of sockets in the kernel queue will not be reduced.4 Close: When we close the connection, we use close to actually just subtract the reference count of the file descriptor by 1, and one fork causes the open see Descriptor reference count in the parent process to be added by 1. So in this case we should do a close to the file descriptor in the parent-child process. If you want to terminate the connection directly, you can use the shu
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.