Skip to content

Instantly share code, notes, and snippets.

@AbhishekGhosh
Created June 8, 2017 20:43
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AbhishekGhosh/b1b296f7ed6e1008f86f373688fba2e4 to your computer and use it in GitHub Desktop.
Save AbhishekGhosh/b1b296f7ed6e1008f86f373688fba2e4 to your computer and use it in GitHub Desktop.
GEO IP TEST PHP Script
<html>
<body>
<?php
$geoip_country_code = getenv(GEOIP_COUNTRY_CODE);
$geoip_country_name = getenv(GEOIP_COUNTRY_NAME);
$geoip_region = getenv(GEOIP_REGION);
$geoip_city = getenv(GEOIP_CITY);
$geoip_postal_code = getenv(GEOIP_POSTAL_CODE);
$geoip_latitude = getenv(GEOIP_LATITUDE);
$geoip_longitude = getenv(GEOIP_LONGITUDE);
echo 'Country code: '.$geoip_country_code.'<br>';
echo 'Country name: '.$geoip_country_name.'<br>';
echo 'Region: '.$geoip_region.'<br>';
echo 'City: '.$geoip_city.'<br>';
echo 'Postal code: '.$geoip_postal_code.'<br>';
echo 'Latitude: '.$geoip_latitude.'<br>';
echo 'Longitude: '.$geoip_longitude.'<br>';
?>
</body>
</html>
@Carlos8312
Copy link

Thank you very much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment