开发者

Getting the Country,City name from IPAddress in PHP

I would like to get the City name,Country Name from IPAddress. I have used the below URL http://www.ipgp.net/api/xml/220.244.120.73.

But in the City field, its giving Area name. For eg,when the user is in Sydney,Australia. Its giving as开发者_开发技巧 Mascot,Australia where Mascot is a place in Sydney.


This is usually not possible, because ISPs don't publicize such detailed information. (IP-based Geolocation services work a lot with guesses and hazy algorithms in the first place.) The more exact the geolocation, the more this would also become a privacy problem.

If you need such detailed information, consider the new HTML 5 Geolocation API that allows visitors to disclose location information voluntarily.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜