annotate index.php @ 44:38d209611508

change includes to assume (contra previos ASSUMES) that we have .user.ini which adds /var/test to include_path
author Charlie Root
date Sun, 06 Jan 2019 07:17:03 -0500
parents dbc006408d2b
children 8bc395c87c6f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
27
1bb0bc3d306a update where to look for geoip info
Robert Boland <robert@markup.co.uk>
parents: 20
diff changeset
1 <?php
44
38d209611508 change includes to assume (contra previos ASSUMES) that we have .user.ini which adds /var/test to include_path
Charlie Root
parents: 43
diff changeset
2 include_once "ywww/dlog.php";
27
1bb0bc3d306a update where to look for geoip info
Robert Boland <robert@markup.co.uk>
parents: 20
diff changeset
3
1bb0bc3d306a update where to look for geoip info
Robert Boland <robert@markup.co.uk>
parents: 20
diff changeset
4 if (isset($_SERVER["GEOIP_COUNTRY_CODE"])) {
1bb0bc3d306a update where to look for geoip info
Robert Boland <robert@markup.co.uk>
parents: 20
diff changeset
5 $country_code = $_SERVER["GEOIP_COUNTRY_CODE"];
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 elseif (isset($_SERVER["REDIRECT_GEOIP_COUNTRY_CODE"])) {
1bb0bc3d306a update where to look for geoip info
Robert Boland <robert@markup.co.uk>
parents: 20
diff changeset
8 $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
9 }
1bb0bc3d306a update where to look for geoip info
Robert Boland <robert@markup.co.uk>
parents: 20
diff changeset
10 else {$country_code = "US" ; }
43
dbc006408d2b ASSUMES we have SetEnv PHP_VALUE "include_path =.:/var/test/private:/var/test/ywww:/usr/share/php" in apache2/.../test.conf
Charlie Root
parents: 27
diff changeset
11
dbc006408d2b ASSUMES we have SetEnv PHP_VALUE "include_path =.:/var/test/private:/var/test/ywww:/usr/share/php" in apache2/.../test.conf
Charlie Root
parents: 27
diff changeset
12 dl("cc: $country_code\n");
27
1bb0bc3d306a update where to look for geoip info
Robert Boland <robert@markup.co.uk>
parents: 20
diff changeset
13
1bb0bc3d306a update where to look for geoip info
Robert Boland <robert@markup.co.uk>
parents: 20
diff changeset
14 switch($country_code) {
1bb0bc3d306a update where to look for geoip info
Robert Boland <robert@markup.co.uk>
parents: 20
diff changeset
15 case "CA":
1bb0bc3d306a update where to look for geoip info
Robert Boland <robert@markup.co.uk>
parents: 20
diff changeset
16 Header( "HTTP/1.1 301 Moved Permanently" );
43
dbc006408d2b ASSUMES we have SetEnv PHP_VALUE "include_path =.:/var/test/private:/var/test/ywww:/usr/share/php" in apache2/.../test.conf
Charlie Root
parents: 27
diff changeset
17 Header ("Location: http://test.markup.co.uk/ywww/ca/" );
27
1bb0bc3d306a update where to look for geoip info
Robert Boland <robert@markup.co.uk>
parents: 20
diff changeset
18 break;
1bb0bc3d306a update where to look for geoip info
Robert Boland <robert@markup.co.uk>
parents: 20
diff changeset
19 case "DE":
1bb0bc3d306a update where to look for geoip info
Robert Boland <robert@markup.co.uk>
parents: 20
diff changeset
20 Header( "HTTP/1.1 301 Moved Permanently" );
43
dbc006408d2b ASSUMES we have SetEnv PHP_VALUE "include_path =.:/var/test/private:/var/test/ywww:/usr/share/php" in apache2/.../test.conf
Charlie Root
parents: 27
diff changeset
21 Header ("Location: http://test.markup.co.uk/ywww/de/" );
27
1bb0bc3d306a update where to look for geoip info
Robert Boland <robert@markup.co.uk>
parents: 20
diff changeset
22 break;
1bb0bc3d306a update where to look for geoip info
Robert Boland <robert@markup.co.uk>
parents: 20
diff changeset
23 case "FR":
1bb0bc3d306a update where to look for geoip info
Robert Boland <robert@markup.co.uk>
parents: 20
diff changeset
24 Header( "HTTP/1.1 301 Moved Permanently" );
43
dbc006408d2b ASSUMES we have SetEnv PHP_VALUE "include_path =.:/var/test/private:/var/test/ywww:/usr/share/php" in apache2/.../test.conf
Charlie Root
parents: 27
diff changeset
25 Header ("Location: http://test.markup.co.uk/ywww/fr/" );
27
1bb0bc3d306a update where to look for geoip info
Robert Boland <robert@markup.co.uk>
parents: 20
diff changeset
26 break;
1bb0bc3d306a update where to look for geoip info
Robert Boland <robert@markup.co.uk>
parents: 20
diff changeset
27 case "GB":
1bb0bc3d306a update where to look for geoip info
Robert Boland <robert@markup.co.uk>
parents: 20
diff changeset
28 Header( "HTTP/1.1 301 Moved Permanently" );
43
dbc006408d2b ASSUMES we have SetEnv PHP_VALUE "include_path =.:/var/test/private:/var/test/ywww:/usr/share/php" in apache2/.../test.conf
Charlie Root
parents: 27
diff changeset
29 Header ("Location: http://test.markup.co.uk/ywww/uk/" );
27
1bb0bc3d306a update where to look for geoip info
Robert Boland <robert@markup.co.uk>
parents: 20
diff changeset
30 break;
1bb0bc3d306a update where to look for geoip info
Robert Boland <robert@markup.co.uk>
parents: 20
diff changeset
31 case "US":
1bb0bc3d306a update where to look for geoip info
Robert Boland <robert@markup.co.uk>
parents: 20
diff changeset
32 Header( "HTTP/1.1 301 Moved Permanently" );
43
dbc006408d2b ASSUMES we have SetEnv PHP_VALUE "include_path =.:/var/test/private:/var/test/ywww:/usr/share/php" in apache2/.../test.conf
Charlie Root
parents: 27
diff changeset
33 Header ("Location: http://test.markup.co.uk/ywww/us/" );
27
1bb0bc3d306a update where to look for geoip info
Robert Boland <robert@markup.co.uk>
parents: 20
diff changeset
34 break;
1bb0bc3d306a update where to look for geoip info
Robert Boland <robert@markup.co.uk>
parents: 20
diff changeset
35 default:
1bb0bc3d306a update where to look for geoip info
Robert Boland <robert@markup.co.uk>
parents: 20
diff changeset
36 Header( "HTTP/1.1 301 Moved Permanently" );
43
dbc006408d2b ASSUMES we have SetEnv PHP_VALUE "include_path =.:/var/test/private:/var/test/ywww:/usr/share/php" in apache2/.../test.conf
Charlie Root
parents: 27
diff changeset
37 Header ("Location: http://test.markup.co.uk/ywww/us/" );
27
1bb0bc3d306a update where to look for geoip info
Robert Boland <robert@markup.co.uk>
parents: 20
diff changeset
38 break;
1bb0bc3d306a update where to look for geoip info
Robert Boland <robert@markup.co.uk>
parents: 20
diff changeset
39 }
0
5f4560ac65b7 original
robert
parents:
diff changeset
40 ?>
5f4560ac65b7 original
robert
parents:
diff changeset
41 <html>
5f4560ac65b7 original
robert
parents:
diff changeset
42 <head>
5f4560ac65b7 original
robert
parents:
diff changeset
43 <title>YourNextRead: Book Recommendations</title>
5f4560ac65b7 original
robert
parents:
diff changeset
44
5f4560ac65b7 original
robert
parents:
diff changeset
45 <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
46 <meta name="google-site-verification" content="0XCtbGM_bvOH363P2XE6DVjh-APTICOREquY8F38T84" />
5f4560ac65b7 original
robert
parents:
diff changeset
47 </HEAD>
5f4560ac65b7 original
robert
parents:
diff changeset
48 <body>
19
84a412b8122c try to protect against a range of missing info
Charlie Root
parents: 16
diff changeset
49 <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
50 </body>
5f4560ac65b7 original
robert
parents:
diff changeset
51