so I was wondering, PHP switch seems like the obvious choice, then I can load the ad manager that is suitable for the visitor's local needs etc
I was considering new ideas but I am not sure about the best approach for a globalized site
Code: Select all
/*Get ip address*/
$ip=$_SERVER['REMOTE_ADDR'];
/* Now get ip details with geoplugin.net */
$geopluginURL='http://www.geoplugin.net/php.gp?ip='.$ip;
$unarr= file_get_contents($geopluginURL); // Get File Contents
$AddArr = unserialize($unarr); // Get PHP values from file contents
/* print_r($AddArr); */ // Print all the values
$city = $AddArr['geoplugin_city']; // City Name
$country = $AddArr['geoplugin_countryName']; // Country Name
$country_code = $AddArr['geoplugin_countryCode']; // Country Code
$currency_code = $AddArr['geoplugin_currencyCode']; // Country Name
$latitude = $AddArr['geoplugin_latitude']; // Latitude
$longitude = $AddArr['geoplugin_longitude']; // Latitude
echo '<strong>IP Address</strong>:- '.$ip.'
';
echo '<strong>City</strong>:- '.$city.'
';
echo '<strong>Country</strong>:- '.$country.'
';
echo '<strong>Country Code</strong>:- '.$country_code.'
';
echo '<strong>Currency Code</strong>:- '.$currency_code.'
';
echo '<strong>Latitude </strong>:- '.$latitude.'
';
echo '<strong>Longitude </strong>:- '.$longitude.'
';