I have followed all the directions given at:
http://www.geoplugin.com/webservices/php
Yet my nothing is popping up the page is just blank ( Yes I have it uploaded on my online sever )
<?php
$user_ip = getenv('REMOTE_ADDR');
$geo = unserialize(file_get_contents("http://www.geoplugin.net/php.gp?ip=$user_ip"));
$city = $geo["geoplugin_city"];
$region = $geo["geoplugin_regionName"];
$country = $geo["geoplugin_countryName"];
echo "City: ".$city."<br>";
echo "Region: ".$region."<br>";
echo "Country: ".$country."<br>";
?>
The only thing that pops up is this
City:
Region:
Country:
With no answers. Help?
Just try
$geo = unserialize(file_get_contents("http://www.geoplugin.net/php.gp?ip=".$user_ip));
array (
'geoplugin_request' => '112.133.198.126',
'geoplugin_status' => 206,
'geoplugin_credit' => 'Some of the returned data includes GeoLite data created by MaxMind, available from http://www.maxmind.com.',
'geoplugin_city' => '',
'geoplugin_region' => '',
'geoplugin_areaCode' => '0',
'geoplugin_dmaCode' => '0',
'geoplugin_countryCode' => 'IN',
'geoplugin_countryName' => 'India',
'geoplugin_continentCode' => 'AS',
'geoplugin_latitude' => '20',
'geoplugin_longitude' => '77',
'geoplugin_regionCode' => '',
'geoplugin_regionName' => NULL,
'geoplugin_currencyCode' => 'INR',
'geoplugin_currencySymbol' => '₨',
'geoplugin_currencySymbol_UTF8' => '₨',
'geoplugin_currencyConverter' => '61.62',
)
The city
and region
fields are blank and only get the country
value
If geoplugin.net was responding perfectly, then stopped, then you have gone over the free lookup limit of 120 requests per minute.
More often than not, this happens when people's sites get spidered by search engine crawlers, which can very quickly take a site's geoplugin.net lookups to over 120 in a minute.