annotate index.php @ 24:341d8c681357

prepare for temporary closure
author Robert Boland <robert@markup.co.uk>
date Tue, 01 Jan 2019 07:29:44 -0500
parents 7679346abfdb
children 1bb0bc3d306a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
5f4560ac65b7 original
robert
parents:
diff changeset
1 <?php
20
7679346abfdb get code and use it
Charlie Root
parents: 19
diff changeset
2 try {$country_code = $_SERVER["GEOIP_COUNTRY_CODE"];
7679346abfdb get code and use it
Charlie Root
parents: 19
diff changeset
3 } catch(Exception $e) { $country_code = "US" ; }
0
5f4560ac65b7 original
robert
parents:
diff changeset
4 switch($country_code){
20
7679346abfdb get code and use it
Charlie Root
parents: 19
diff changeset
5 case "CA":
0
5f4560ac65b7 original
robert
parents:
diff changeset
6 Header( "HTTP/1.1 301 Moved Permanently" );
5f4560ac65b7 original
robert
parents:
diff changeset
7 Header ("Location: http://www.yournextread.com/ca/" );
5f4560ac65b7 original
robert
parents:
diff changeset
8 break;
5f4560ac65b7 original
robert
parents:
diff changeset
9 case "DE":
5f4560ac65b7 original
robert
parents:
diff changeset
10 Header( "HTTP/1.1 301 Moved Permanently" );
5f4560ac65b7 original
robert
parents:
diff changeset
11 Header ("Location: http://www.yournextread.com/de/" );
5f4560ac65b7 original
robert
parents:
diff changeset
12 break;
5f4560ac65b7 original
robert
parents:
diff changeset
13 case "FR":
5f4560ac65b7 original
robert
parents:
diff changeset
14 Header( "HTTP/1.1 301 Moved Permanently" );
5f4560ac65b7 original
robert
parents:
diff changeset
15 Header ("Location: http://www.yournextread.com/fr/" );
5f4560ac65b7 original
robert
parents:
diff changeset
16 break;
5f4560ac65b7 original
robert
parents:
diff changeset
17 case "GB":
5f4560ac65b7 original
robert
parents:
diff changeset
18 Header( "HTTP/1.1 301 Moved Permanently" );
5f4560ac65b7 original
robert
parents:
diff changeset
19 Header ("Location: http://www.yournextread.com/uk/" );
5f4560ac65b7 original
robert
parents:
diff changeset
20 break;
5f4560ac65b7 original
robert
parents:
diff changeset
21 case "US":
5f4560ac65b7 original
robert
parents:
diff changeset
22 Header( "HTTP/1.1 301 Moved Permanently" );
5f4560ac65b7 original
robert
parents:
diff changeset
23 Header ("Location: http://www.yournextread.com/us/" );
20
7679346abfdb get code and use it
Charlie Root
parents: 19
diff changeset
24 break;
0
5f4560ac65b7 original
robert
parents:
diff changeset
25 default:
5f4560ac65b7 original
robert
parents:
diff changeset
26 Header( "HTTP/1.1 301 Moved Permanently" );
5f4560ac65b7 original
robert
parents:
diff changeset
27 Header ("Location: http://www.yournextread.com/us/" );
5f4560ac65b7 original
robert
parents:
diff changeset
28 break;
5f4560ac65b7 original
robert
parents:
diff changeset
29 }
5f4560ac65b7 original
robert
parents:
diff changeset
30 ?>
5f4560ac65b7 original
robert
parents:
diff changeset
31 <html>
5f4560ac65b7 original
robert
parents:
diff changeset
32 <head>
5f4560ac65b7 original
robert
parents:
diff changeset
33 <title>YourNextRead: Book Recommendations</title>
5f4560ac65b7 original
robert
parents:
diff changeset
34
5f4560ac65b7 original
robert
parents:
diff changeset
35 <META NAME="Description" CONTENT="YourNextRead recommends your next book. YourNextRead provides a book recommendation system showing aggregated book reviews, updated by real peoples opinions, in a simple visual map, helping you to decide 'What Should I Read Next?'. Perfect for both bookworms and casual readers!">
5f4560ac65b7 original
robert
parents:
diff changeset
36 <meta name="google-site-verification" content="0XCtbGM_bvOH363P2XE6DVjh-APTICOREquY8F38T84" />
5f4560ac65b7 original
robert
parents:
diff changeset
37 </HEAD>
5f4560ac65b7 original
robert
parents:
diff changeset
38 <body>
19
84a412b8122c try to protect against a range of missing info
Charlie Root
parents: 16
diff changeset
39 <script src="//z-na.amazon-adsystem.com/widgets/onejs?MarketPlace=US&adInstanceId=322bafc0-69fa-4664-8e1c-0b9159259748"></script>
0
5f4560ac65b7 original
robert
parents:
diff changeset
40 </body>
5f4560ac65b7 original
robert
parents:
diff changeset
41