Solved

IP/country mapping of website's visitors

Posted on 2013-01-03
5
604 Views
Last Modified: 2013-01-19
I'm currently looking for ways to automatically identifying my website's visitor's country location through their originating IP address using JavaScript/jQuery.  I'm sure there is a way but I'm not sure how.
0
Comment
Question by:snajalm
5 Comments
 
LVL 12

Assisted Solution

by:sivagnanam chandrakanth
sivagnanam chandrakanth earned 125 total points
ID: 38742779
Just create a php file with the following code:

echo ' [ { "ip" : "$_SERVER['REMOTE_ADDR']" } ]';

and then ping that with get JSON

see this

http://stackoverflow.com/questions/1641868/how-to-get-client-ip-address-using-jquery
0
 
LVL 11

Assisted Solution

by:un1x86
un1x86 earned 100 total points
ID: 38742784
Hi

You could make use of the geoplugin api.

http://www.geoplugin.com/quickstart#how_to_geo-localize_your_visitors

For instance

http://www.geoplugin.net/json.gp?ip=<your ip here>&jsoncallback=<suitable javascript function in your source>
0
 
LVL 36

Assisted Solution

by:Loganathan Natarajan
Loganathan Natarajan earned 75 total points
ID: 38742786
0
 
LVL 82

Expert Comment

by:Dave Baldwin
ID: 38742905
I don't think you can do it with just JavaScript/jQuery.  Here's an API I use with PHP on several sites.  http://dev.maxmind.com/geoip/geolite
0
 
LVL 82

Accepted Solution

by:
Dave Baldwin earned 200 total points
ID: 38742909
It looks like they do have a javascript based service.  http://dev.maxmind.com/geoip/javascript
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
This article discusses how to create an extensible mechanism for linked drop downs.
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now