title: How to obtain accurate latitude and longitude of user machine based on IP address
body: <p>In my PHP based application i would like to capture the location of user machine when user logs in to the webapp based on IP address.</p>
  
  <p>I followed this method:</p>
  
  <pre><code>$url = "http://freegeoip.net/json/$ip";
  $ch = curl_init();
  
  curl_setopt($ch, CURLOPT_URL, $url);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
  $data = curl_exec($ch);
  curl_close($ch);
  </code></pre>
  
  <p>i am getting the latitude and longitude values but these are not exact, instead they are absolute. In the response i am getting JSON like this:</p>
  
  <pre><code>{
  ["ip"]=&gt; string(11) "59.90.210.9" 
  ["country_code"]=&gt; string(2) "IN" 
  ["country_name"]=&gt; string(5) "India" 
  ["region_code"]=&gt; string(0) "" 
  ["region_name"]=&gt; string(0) "" 
  ["city"]=&gt; string(0) "" 
  ["zip_code"]=&gt; string(0) "" 
  ["time_zone"]=&gt; string(12) "Asia/Kolkata" 
  ["latitude"]=&gt; int(20) 
  ["longitude"]=&gt; int(77) 
  ["metro_code"]=&gt; int(0) 
  } 
  </code></pre>
  
  <p>No city no zip nothing. Is there any better API to get exact things as required? Thanks in advance for any response.</p>