Is it possible to get user location information through your ip?

3

Is there any possibility using the schedule to get locations of an alleged visitor to your website?

  

Example: "So-and-so" with ip: 192.168.254.1 visited my site:   www.mysite.com

Using this obtained ip can I accurately determine the geographic information of such user? The location details I am referring to are the country , the state , the city and if possible the neighborhood .

I want to know if through programming (regardless of language) I can get such data from a visitor to my site.

    
asked by anonymous 15.02.2016 / 18:31

1 answer

0
function getLocation(){
  if (navigator.geolocation)
    {
    navigator.geolocation.getCurrentPosition(showPosition);
    }
  else{
    alert("O seu navegador não suporta Geolocalização.");
    }
}

function showPosition(position){
   alert("Latitude: " + position.coords.latitude + " Longitude: " + position.coords.longitude);  
}
    
15.02.2016 / 19:33