GeoIP and IP to Country in PHP [duplicate]

痴心易碎 提交于 2019-12-10 07:32:50

问题


Possible Duplicate:
How to get the page visitors Country with PHP?

I've been searching everywhere, and I can't seem to find anything. I need a free PHP GeoIP/Ip to country.

All I can find is that it gives me the country and small form of the country. I also would like to have information of possible street or coords, city, and maybe host information?

I need this because I am creating a PHP CMS (for myself and clients) and I want to track ips.

I don't really want an API, I want it like a database. Any ideas ?


回答1:


MaxMind GeoLite database: http://dev.maxmind.com/geoip/geolite OR pay for the full version: http://www.maxmind.com/en/geolocation_landing

They also have php libraries to go with it: http://dev.maxmind.com/geoip/downloadable

As for PHP, checkout GeoIP library and Example geoip_record_by_name()

For a database, you could make your own database overtime... and fill it with cached collected data but I doubt that would be as accurate as MaxMind's data.

There are many other methods you could use and couple them with a custom database or even combine it with the GeoLite db: geoplugin, ipinfodb




回答2:


Google is your best friend :).

you should be able to make it yourself with this information (API):

https://ipstack.com/



来源:https://stackoverflow.com/questions/13424336/geoip-and-ip-to-country-in-php

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!