annotate geoiptest.php @ 30:b1bbf44c701b

standarise semaphore use
author Robert Boland <robert@markup.co.uk>
date Fri, 04 Jan 2019 08:50:23 -0500
parents 1bb0bc3d306a
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
6
077b0a0a3e6d remaining originals according to dependency walk
Robert Boland <robert@markup.co.uk>
parents:
diff changeset
1 <html>
077b0a0a3e6d remaining originals according to dependency walk
Robert Boland <robert@markup.co.uk>
parents:
diff changeset
2 <body>
077b0a0a3e6d remaining originals according to dependency walk
Robert Boland <robert@markup.co.uk>
parents:
diff changeset
3 <?php
27
1bb0bc3d306a update where to look for geoip info
Robert Boland <robert@markup.co.uk>
parents: 20
diff changeset
4 if (isset($_SERVER["GEOIP_COUNTRY_NAME"])) {
16
093e42d5a874 minor tidy-ups on new-server install
Henry S. Thompson <ht@inf.ed.ac.uk>
parents: 6
diff changeset
5 $country_name = $_SERVER["GEOIP_COUNTRY_NAME"];
27
1bb0bc3d306a update where to look for geoip info
Robert Boland <robert@markup.co.uk>
parents: 20
diff changeset
6 }
1bb0bc3d306a update where to look for geoip info
Robert Boland <robert@markup.co.uk>
parents: 20
diff changeset
7 else {
1bb0bc3d306a update where to look for geoip info
Robert Boland <robert@markup.co.uk>
parents: 20
diff changeset
8 $country_name = $_SERVER["REDIRECT_GEOIP_COUNTRY_NAME"];
1bb0bc3d306a update where to look for geoip info
Robert Boland <robert@markup.co.uk>
parents: 20
diff changeset
9 }
1bb0bc3d306a update where to look for geoip info
Robert Boland <robert@markup.co.uk>
parents: 20
diff changeset
10 if (isset($_SERVER["GEOIP_COUNTRY_CODE"])) {
20
7679346abfdb get code and use it
Charlie Root
parents: 16
diff changeset
11 $country_code = $_SERVER["GEOIP_COUNTRY_CODE"];
27
1bb0bc3d306a update where to look for geoip info
Robert Boland <robert@markup.co.uk>
parents: 20
diff changeset
12 }
1bb0bc3d306a update where to look for geoip info
Robert Boland <robert@markup.co.uk>
parents: 20
diff changeset
13 else {
1bb0bc3d306a update where to look for geoip info
Robert Boland <robert@markup.co.uk>
parents: 20
diff changeset
14 $country_code = $_SERVER["REDIRECT_GEOIP_COUNTRY_CODE"];
1bb0bc3d306a update where to look for geoip info
Robert Boland <robert@markup.co.uk>
parents: 20
diff changeset
15 }
20
7679346abfdb get code and use it
Charlie Root
parents: 16
diff changeset
16 print "Country: $country_name , code: $country_code";
6
077b0a0a3e6d remaining originals according to dependency walk
Robert Boland <robert@markup.co.uk>
parents:
diff changeset
17 ?>
077b0a0a3e6d remaining originals according to dependency walk
Robert Boland <robert@markup.co.uk>
parents:
diff changeset
18 </body>
077b0a0a3e6d remaining originals according to dependency walk
Robert Boland <robert@markup.co.uk>
parents:
diff changeset
19 </html>