【问题标题】:GeoIP and IP to Country in PHP [duplicate]PHP中的GeoIP和IP到国家[重复]
【发布时间】:2012-11-05 15:15:21
【问题描述】:

可能重复:
How to get the page visitors Country with PHP?

我一直在到处寻找,但似乎找不到任何东西。我需要一个免费的 PHP GeoIP/IP 到国家。

我所能找到的只是它给了我国家和国家的小形式。我还想了解可能的街道或坐标、城市以及主机信息?

我需要这个,因为我正在创建一个 PHP CMS(为我自己和客户)并且我想跟踪 ips。

我并不真正想要 API,我想要它就像一个数据库。有什么想法吗?

【问题讨论】:

    标签: php geoip


    【解决方案1】:

    Google 是你最好的朋友 :)。

    您应该能够使用此信息 (API) 自己制作:

    https://ipstack.com/

    【讨论】:

    【解决方案2】:

    MaxMind GeoLite 数据库:http://dev.maxmind.com/geoip/geolite 付费购买完整版:http://www.maxmind.com/en/geolocation_landing

    他们也有相应的 php 库:http://dev.maxmind.com/geoip/downloadable

    至于 PHP,请查看 GeoIP libraryExample geoip_record_by_name()

    对于数据库,您可以让自己的数据库超时......并用缓存的收集数据填充它,但我怀疑这会像 MaxMind 的数据一样准确。

    您可以使用许多其他方法,并将它们与自定义数据库相结合,甚至将其与 GeoLite 数据库结合使用:geopluginipinfodb

    【讨论】:

      猜你喜欢
      • 2011-05-16
      • 2013-11-08
      • 2012-04-22
      • 2014-11-15
      • 1970-01-01
      • 2011-04-08
      • 1970-01-01
      • 2023-01-19
      相关资源
      最近更新 更多