Created
June 8, 2017 20:43
-
-
Save AbhishekGhosh/b1b296f7ed6e1008f86f373688fba2e4 to your computer and use it in GitHub Desktop.
GEO IP TEST PHP Script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you very much.