Questions about the IP address region obtained by PHP

Source: Internet
Author: User
Region where PHP gets IP addresses. Ip address location obtained by PHP in the ip address Library
Http://hi.baidu.com/sslook_com/item/3e74cd13381f838c89a95637
Based on the above content test, the queried content is: Address
I would like to ask why this query only contains two words. normally, it should be Shanghai Telecom or something else. The ip library is also up-to-date.

------ Solution --------------------
If you want to obtain the IP address, there are many interfaces that can be directly called, such as Sina.
If you want to study the code, I guess 1. you cannot get the IP address. 2. there is a problem with the code.
------ Solution --------------------
Discussion

Is there a problem with obtaining the IP address at the top?

I can't get anything from echo $ xp_UserIp.

------ Solution --------------------
What is echo $ xp_UserIp? Custom variables?

Obtain the IP address, which should be echo $ _ SERVER ["REMOTE_ADDR"]; and obtain a result similar to 192.168.0.0.
To convert to the "Shanghai Telecom" style, you need to download a dedicated database or use an API for query.
------ Solution --------------------
Discussion
$ Xp_userip: the IP address is correct. it has been verified and can be obtained.
In addition, we are currently using an ip address Library recommended on the internet. What is your dedicated data? I know the api method. now I want to learn this method.
Please help me to answer this question, because this method is basically collected on the Internet, and I don't know how they succeeded. I don't know how they all collect an incorrect method.

------ Solution --------------------
How can this problem be solved? I can get it here. you should check it carefully.
Result: 119.75.218.70

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.