检查用户所在国家/地区的最佳解决方案是什么? [英] What's the best solution to check a users country?

查看:86
本文介绍了检查用户所在国家/地区的最佳解决方案是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

提供API的服务

我读到/听说有很多服务可以使API做到这一点,但是我真的不想依靠任何人,所以请问是否有一种不用他们的方式让我知道.

I read/heard that there are a lots of services that gives API's to do this, however I don't really want to rely on anybody so please if there is a way to do it without them let me know.

服务器端

我也阅读/听说这是在服务器端编码中完成的,这让我感到困惑,我一直认为这是由Javascript完成的.​​

And also I read/heard that this is done in server side coding what makes me confused, I always thought that this is done by Javascript.

IP列表

我还阅读/听说提供API的那些服务,它们具有来自ISP的非常大的IP列表,并且它们可以通过此列表确定国家/地区,这是真的吗?而且,如果我想单独使用而不使用API​​,我也应该有一个列表吗?

And I also read/heard that those services that gives API's they have a very huge list of IP's from ISP's and they can determine the country by this list, is this true? And if I want to make it alone without API's, should I have a list too?

推荐答案

查找时,我使用了以下脚本: http://www.phptutorial.info/iptocountry/the_script.html

When I did my lookup, I used this script : http://www.phptutorial.info/iptocountry/the_script.html

数据库是php文件的列表,您可以订阅一个列表,该列表将通知您数据库更新.如果您没有数据库,则非常有用:)

The db is a list of php files and you can subscribe to a list which will notify you of database updates. Pretty useful if you don't have a database :)

这篇关于检查用户所在国家/地区的最佳解决方案是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆