diff options
Diffstat (limited to 'en/downloads/debug/index.php')
-rw-r--r-- | en/downloads/debug/index.php | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/en/downloads/debug/index.php b/en/downloads/debug/index.php new file mode 100644 index 000000000..c540523d7 --- /dev/null +++ b/en/downloads/debug/index.php @@ -0,0 +1,21 @@ +<?php + +$ips = array(); + +if (isset($_SERVER['HTTP_X_FORWARDED_FOR']) + && $str = $_SERVER['HTTP_X_FORWARDED_FOR']) +{ + $arr = explode(', ', $str); + $ips['ip'] = $arr[0]; + $ips['gw'] = $_SERVER['REMOTE_ADDR']; +} +else + $ips['ip'] = $_SERVER['REMOTE_ADDR']; + +echo '<ul>'; +foreach ($ips as $label => $ip) { + echo sprintf('<li>%s is in %s, %s</li>', + @geoip_country_code_by_name($ip), + @geoip_continent_code_by_name($ip)); +} + |