Solved

IP/country mapping of website's visitors

Posted on 2013-01-03
5
607 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 83

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 83

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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

813 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

18 Experts available now in Live!

Get 1:1 Help Now