检查用户所在国家/地区的最佳解决方案是什么?
提供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 :)