/    Sign up×
Community /Pin to ProfileBookmark

Greeting depending on IP address

Hello folks,

I’m new to javascript but i know what it can do.
I think what i want is doable with javascript but… no clue how.
My website receives a lot of visitors from many different countries, i’d like a script to see the IP address and show a greeting in the language of that person or redirect to a page on my site that has the greeting on it.
Or maybe there is an easier, simpler protocol to recognize what country a visitor is from ?
Can anyone help me or guide me in the right direction ?
Thanks so much,

Jay

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@blue-eye-labsJan 05.2008 — I got this from http://javascript.internet.com/user-details/ip-address.html

[CODE]
var ip = '<!--#echo var="REMOTE_ADDR"-->';
[/CODE]


Here's some stuff about language:

http://javascript.internet.com/user-details/language.html
Copy linkTweet thisAlerts:
@Angry_Black_ManJan 06.2008 — javascript used to be able to get a person's ip address. now, you have to use something else. those things include, but are not limited to server side coding such as PHP, ASP, etc. also, the method noted above uses SSI (server side include) to gather the information. it is highly likely (but not assured) that your web host allows the use of SSI. the other languages (PHP, ASP) are much more unlikely (on a free web host). if the echo thing doesnt work, try changing your page's extention from "htm" or "html" to "shtml". if that still doesnt work, your provider doesnt support SSI.
Copy linkTweet thisAlerts:
@blue-eye-labsJan 06.2008 — I would recommend using PHP, as it's pretty painless. But as aaron.martinas said, if you're using a free host it's unlikely that you'll have it, otherwise I'd definitely consider learning it.
×

Success!

Help @Pr0digy_mac_com spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.20,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...