This question already has an answer here:
I'm using GeoPlugin for my php project now. But the plugin always give me the longitude and latitude which my service provider at, and what I want is the location of the user, anybody can help me?
<?php
$user_ip = getenv('REMOTE_ADDR');
$geo = unserialize(file_get_contents("http://www.geoplugin.net/php.gp?
ip=$user_ip"));
$log = $geo["geoplugin_latitude"];
$lad = $geo["geoplugin_longitude"];
echo "$log";
echo "<br></br>";
echo "$lad";
?>
</div>