[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 616
  • Last Modified:

IP/country mapping of website's visitors

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
snajalm
Asked:
snajalm
4 Solutions
 
sivagnanam chandrakanthTechnical LeadCommented:
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
 
Chris SandriniSenior System EngineerCommented:
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
 
Loganathan NatarajanLAMP DeveloperCommented:
0
 
Dave BaldwinFixer of ProblemsCommented:
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
 
Dave BaldwinFixer of ProblemsCommented:
It looks like they do have a javascript based service.  http://dev.maxmind.com/geoip/javascript
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now