我已经尝试了HTML 5地理定位,GEOIP和许多其他服务。但是它仍然不是很好。即使我只需要获取访问者的国家/地区也可以。
IMO the best way is to use GEOIP, you can also get the free city database if you want to drill down the location further. I wrote a simple class that works with apache's mod_geoip as well as instructions on how to install the module and geoip databases. It's on GitHub if you want to take a look.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.