Mercurial > hg > ywww
comparison geoiptest.php @ 27:1bb0bc3d306a
update where to look for geoip info
author | Robert Boland <robert@markup.co.uk> |
---|---|
date | Fri, 04 Jan 2019 08:45:42 -0500 |
parents | 7679346abfdb |
children |
comparison
equal
deleted
inserted
replaced
26:55a76c257dad | 27:1bb0bc3d306a |
---|---|
1 <html> | 1 <html> |
2 <body> | 2 <body> |
3 <?php | 3 <?php |
4 if (isset($_SERVER["GEOIP_COUNTRY_NAME"])) { | |
4 $country_name = $_SERVER["GEOIP_COUNTRY_NAME"]; | 5 $country_name = $_SERVER["GEOIP_COUNTRY_NAME"]; |
6 } | |
7 else { | |
8 $country_name = $_SERVER["REDIRECT_GEOIP_COUNTRY_NAME"]; | |
9 } | |
10 if (isset($_SERVER["GEOIP_COUNTRY_CODE"])) { | |
5 $country_code = $_SERVER["GEOIP_COUNTRY_CODE"]; | 11 $country_code = $_SERVER["GEOIP_COUNTRY_CODE"]; |
12 } | |
13 else { | |
14 $country_code = $_SERVER["REDIRECT_GEOIP_COUNTRY_CODE"]; | |
15 } | |
6 print "Country: $country_name , code: $country_code"; | 16 print "Country: $country_name , code: $country_code"; |
7 ?> | 17 ?> |
8 </body> | 18 </body> |
9 </html> | 19 </html> |