PHP: user location map via geolocation IP

Asked

Viewed 757 times

0

Good Night , I have in my company’s database with several IP addresses ( in history format ) and the current IP of the user accessing my site.

I would like to know if you can with this data set up a map of access , showing which countries I have the largest flow of users .

The system automatically already determines the acronym of the country through php and a Geoip database that I configured , I would like to know then how to organize this data on a map.

  • You can use a ready-made API: http://www.infosniper.net/services.php

  • here in Stack Overflow itself you have the answer. Click here.

  • @Rpgboss , can she assemble the heat maps? From what I’ve seen she returns data that I already have.

  • @Marceloágil the location I already have , I want to put together a map with her.

  • Ah tah, you want to build a map like Wordpress.

  • I’ve never seen this Wordpress , I want to assemble something efficient because are 3 thousand users , 3 thousand IPS , so it gets bad to pull data .

  • Wordpress has a menu on the control panel, where you can analyze the visits of the day, of the week, of the month or general (from the beginning of the record), and it distributes on the world map with color levels (the redder the more visits) of the countries to see what is the highest frequency of visits. It’s not hard to do, but it takes some time, so suggest downloading a ready-made API. https://i.stack.Imgur.com/9J8Ko.png

Show 2 more comments

1 answer

0

  • HI friend, I can build this map without using Apis?

  • When you get it you will have practically created an API without realizing it :)

  • I say API like from Google .

  • Hello, you already have the acronyms of the countries in your database...so you can create a gradient according to the quantity in a range that you determine. Done this, just take the Svgs from the world map and color as this degrade.

  • Yes, this is the easy friend the problem is at the time of generating and comparing the Ips with that of the GEOIP database.

  • It becomes costly for the server , mysql gets 100% CPU usage with 2 thousand ips.

  • I think the best thing is that you create a process the part that makes this comparison of the IP with the database and updates the table already with the right value. Let this process run in parallel every hour by picking up the new Ips within this time range... that is, you will have a delay of 1 hour to show the information.

Show 2 more comments

Browser other questions tagged

You are not signed in. Login or sign up in order to post.