开发者

find location by using ip address in php [duplicate]

This question already has answers here: Closed 11 years ago.

Possible Duplicate:

IP to location + local time?

i want to know ,is there any way to find a particular client location by using his ip address.

like---

  1. your ip - w.x.y.z
  2. your country - country name
  3. your state - state name
  4. your place/town/city/village - place/town/city/village name
  5. your ISP provider - isp provider name
  6. your home street开发者_高级运维 - home address (if possible)

thanks.


MaxMind offers several options. Have a look at the GeoIP PHP API. The paid version of their data offers much more but the GeoLite Country and GeoLite City products they offer may work quite well for you.

For more information, you can also refer to the documentation on PHP's website as well. It includes instructions on setting it up.


You have to look that up in a database. There are various databases of different quality and price. A quite good starting point would be here: http://www.joefission.com/2007/11/geocoding-based-on-an-ip-address/

You have to try which database suits your need, and how much you are willing to spend. Quality is not that good. You can't expect street names. For me here in Austria, it is somtimes up to ~100km wrong.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜