aboutsummaryrefslogtreecommitdiffstats
path: root/en
diff options
context:
space:
mode:
authorRomain d'Alverny <rda@mageia.org>2012-02-21 18:39:18 +0000
committerRomain d'Alverny <rda@mageia.org>2012-02-21 18:39:18 +0000
commit2013377a19263013aa83c1cefc76ef1b674b231d (patch)
treee98a9e08015b8b8ad56ce69aa0556228fbe6fdad /en
parent24f066edb190eed44af05558a50a8dce5a3dfc89 (diff)
downloadwww-2013377a19263013aa83c1cefc76ef1b674b231d.tar
www-2013377a19263013aa83c1cefc76ef1b674b231d.tar.gz
www-2013377a19263013aa83c1cefc76ef1b674b231d.tar.bz2
www-2013377a19263013aa83c1cefc76ef1b674b231d.tar.xz
www-2013377a19263013aa83c1cefc76ef1b674b231d.zip
test code
Diffstat (limited to 'en')
-rw-r--r--en/downloads/debug/index.php21
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));
+}
+