显示基于国家/地区的脚本 [英] Showing script based on the country

查看:79
本文介绍了显示基于国家/地区的脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些javascripts。我想基于

显示某个脚本的查看器的国家/地区ip,我将如何实现这一目标?是否有html我

可以用来运行基于国家ip的javascript?

I have a few javascripts. I would like to show a certain script based on
the country ip of the viewer, how would I achieve this? is there html I
could use to run the javascript based on the country ip?

推荐答案

Nospam写道:
Nospam wrote:

我有一些javascripts。我想基于

显示某个脚本的查看器的国家/地区ip,我将如何实现这一目标?是否有html我

可以用来运行基于国家ip的javascript?

I have a few javascripts. I would like to show a certain script based on
the country ip of the viewer, how would I achieve this? is there html I
could use to run the javascript based on the country ip?



你不能做它可靠。你所能做的只是猜测连接到你的

ip的国家,这并不总是准确的。另外,他们可能会在世界任何地方使用代理商获得



-

======== ==========

删除x来自我的电子邮件地址

Jerry Stuckle

JDS计算机培训公司
js ******* @ attglobal.net

==================

You can''t do it reliably. All you can do is take a guess at the country of the
ip connecting to you, and that won''t always be accurate. Plus they might be
using a proxy anyplace in the world.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================


2006年7月3日星期一22:22:08 -0400,Jerry Stuckle用手指敲击

键盘并输入:
On Mon, 03 Jul 2006 22:22:08 -0400, Jerry Stuckle put finger to
keyboard and typed:

> Nospam写道:
>Nospam wrote:

>我有一些javascripts。我想基于观众的国家IP显示一个特定的脚本,我将如何实现这一目标?是否有我可以用来运行基于国家IP的javascript的HTML?

>I have a few javascripts. I would like to show a certain script based on
the country ip of the viewer, how would I achieve this? is there html I
could use to run the javascript based on the country ip?


你不能可靠地做到这一点。您所能做的只是猜测连接到您的国家/地区的IP,这并不总是准确的。此外,他们可能会在世界任何地方使用代理。


You can''t do it reliably. All you can do is take a guess at the country of the
ip connecting to you, and that won''t always be accurate. Plus they might be
using a proxy anyplace in the world.



这是真的,但它并不像听起来那么糟糕。自由地

可用的Geo-IP数据库将提供超过95%的准确度,这通常足以满足大多数目的。代理并不是一个主要问题,因为几乎所有配置良好的代理都会在HTTP-FORWARDED-FOR标头中传递

上的原始IP。那些通常不是那些故意设计来匿名起源的人,而且那是'b $ b'相当罕见。


主要问题是AOL,无论用户的实际位置如何,它总是显示为US

,因为AOL配置全部

全球地址来自同一个美国分配的游泳池。因此,要获得准确的AOL用户的地理位置,您需要访问AOL的

内部数据库,而且这是免费的。一些商业

产品包括它(以及其他ISP跨境数据库),并且

具有这样的细节水平,你可以获得超过99%的准确度 - 提供

你准备付钱了。


要回到OP的问题,Geo-IP检测最好完成

服务器端使用脚本和数据库的组合,因为你需要对相当大量的数据进行交叉检查。

对于大多数服务器端脚本/数据库来说,这是非常微不足道的
组合,例如PHP / MySQL或ASP / MSSQL,但你确实需要一个

熟悉这些以便使用它们。如果您不想运行自己的数据库,我建议使用MaxMind的免费软件二进制数据

,以及它们提供的一个API您选择的
脚本语言:

http://www.maxmind.com/app/geoip_country


马克

-

访问: http://names.orangehedgehog.com - 英国姓氏分发概况
听: http://www.goodge.co .uk / files / dweeb.mp3 - 你会喜欢的!

That''s true, but it''s not quite as bad as you make it sound. Freely
available Geo-IP databases will give over 95% accuracy, which is
usually enough for most purposes. Proxies aren''t really a major issue,
as almost all well-configured proxies will pass the originating IP on
in the HTTP-FORWARDED-FOR header. Those that don''t are generally those
which are deliberately designed to anonymise the origin, and that''s
fairly rare.

The main problem is AOL, which will always appear as the US
irrespective of the user''s actual location, as AOL configures all its
worldwide addresses from the same US-allocated pool. To get accurate
geo-location of AOL users, therefore, you need access to AOL''s
internal database, and that isn''t available for free. Some commercial
products include it (as well as other ISP cross-border databases), and
with that level of detail you can get over 99% accuracy - provided
you''re prepared to pay for it.

To go back to the OP''s question, Geo-IP detection is best done
server-side using a combination of scripting and a database, as you''re
going to need to cross-check against a quite large amount of data.
It''s pretty trivial with most server-side scripting/database
combinations, such as PHP/MySQL or ASP/MSSQL, but you do need a
certain familiarity with these in order to use them. If you don''t want
to run your own database, I''d suggest using the freeware binary data
from MaxMind, together with one of their supplied APIs in the
scripting language of your choice:

http://www.maxmind.com/app/geoip_country

Mark
--
Visit: http://names.orangehedgehog.com - British surname distribution profiles
Listen: http://www.goodge.co.uk/files/dweeb.mp3 - you''ll love it!


为了进一步培养人类,Jerry Stuckle

< js ******* @ attglobal.netvouchsafed:
To further the education of mankind, Jerry Stuckle
<js*******@attglobal.netvouchsafed:

Nospam写道:
Nospam wrote:

>我有af ew javascripts。我想根据观众的国家IP显示一个特定的剧本,我将如何实现这一目标?是否有我可以用来运行基于国家ip的javascript的HTML?

>I have a few javascripts. I would like to show a certain script
based on the country ip of the viewer, how would I achieve this? is
there html I could use to run the javascript based on the country ip?



你不能可靠地做到这一点。你所能做的只是猜测连接到你的ip的

国家,并且这并不总是准确的。此外,他们可能在世界任何地方使用代理。


You can''t do it reliably. All you can do is take a guess at the
country of the ip connecting to you, and that won''t always be
accurate. Plus they might be using a proxy anyplace in the world.



是的。有一次我在比洛克西使用代理与巴约讷的

moxie聊天...


-

Neredbojias

Infinity有其限制。

Yeah. One time I used a proxy in Biloxi to chat with some foxy with the
moxie in Bayonne...

--
Neredbojias
Infinity has its limits.


这篇关于显示基于国家/地区的脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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