# HG changeset patch # User Henry S. Thompson # Date 1546780187 18000 # Node ID 8bc395c87c6f4ebba1cac60437f0dbe81d3b42a5 # Parent 38d20961150887195393fb0d05fc798ac35392f1 less built-in use of full site address diff -r 38d209611508 -r 8bc395c87c6f index.php --- a/index.php Sun Jan 06 07:17:03 2019 -0500 +++ b/index.php Sun Jan 06 08:09:47 2019 -0500 @@ -11,30 +11,35 @@ dl("cc: $country_code\n"); +$home=$_SERVER['SERVER_NAME']; +$path=$_SERVER['SCRIPT_NAME']; +$myBase="http://$home".substr($path,0,strlen($path)-10); +dl("base: $myBase\n"); + switch($country_code) { case "CA": Header( "HTTP/1.1 301 Moved Permanently" ); - Header ("Location: http://test.markup.co.uk/ywww/ca/" ); + Header ("Location: $myBase/ca/" ); break; case "DE": Header( "HTTP/1.1 301 Moved Permanently" ); - Header ("Location: http://test.markup.co.uk/ywww/de/" ); + Header ("Location: $myBase/de/" ); break; case "FR": Header( "HTTP/1.1 301 Moved Permanently" ); - Header ("Location: http://test.markup.co.uk/ywww/fr/" ); + Header ("Location: $myBase/fr/" ); break; case "GB": Header( "HTTP/1.1 301 Moved Permanently" ); - Header ("Location: http://test.markup.co.uk/ywww/uk/" ); + Header ("Location: $myBase/uk/" ); break; case "US": Header( "HTTP/1.1 301 Moved Permanently" ); - Header ("Location: http://test.markup.co.uk/ywww/us/" ); + Header ("Location: $myBase/us/" ); break; default: Header( "HTTP/1.1 301 Moved Permanently" ); - Header ("Location: http://test.markup.co.uk/ywww/us/" ); + Header ("Location: $myBase/us/" ); break; } ?> diff -r 38d209611508 -r 8bc395c87c6f us/index.php --- a/us/index.php Sun Jan 06 07:17:03 2019 -0500 +++ b/us/index.php Sun Jan 06 08:09:47 2019 -0500 @@ -80,7 +80,7 @@
  • Internet Explorer
  • Thank you for using YourNextRead

    - \"YourNextRead\"/ + \"YourNextRead\"/ "; if($iPhone && !$iPad) { @@ -112,7 +112,7 @@ for($i=0;$iList[$id]->ListDetails->Book);$i++){ $bookTitle = $xml->List[$id]->ListDetails->Book[$i]->BookTitle; $isbn = $xml->List[$id]->ListDetails->Book[$i]->ISBN; - echo "$bookTitle "; + echo "$bookTitle "; } } } @@ -245,7 +245,7 @@ $recommended .= " $titleL by $authorL,"; $underAuthor = str_replace(" ","_",$authorL); $underTitle = str_replace(" ","_",$titleL); - $linkedRecommended .= "$titleL by $authorL, "; + $linkedRecommended .= "$titleL by $authorL, "; } } @@ -263,7 +263,7 @@

  • Internet Explorer
  • Thank you for using YourNextRead

    - \"YourNextRead\"/ + \"YourNextRead\"/ "; if($iPhone && !$iPad) { @@ -283,10 +283,10 @@ echo $linkedRecommended . "

    "; echo "

    " . $vote . "

    "; - echo "Change to YourNextRead Germany, "; - echo "Change to YourNextRead Canada, "; - echo "Change to YourNextRead France, "; - echo "Change to YourNextRead USA"; + echo "Change to YourNextRead Germany, "; + echo "Change to YourNextRead Canada, "; + echo "Change to YourNextRead France, "; + echo "Change to YourNextRead USA"; echo ", See this on YourNextPresent, "; echo "Switch to YourNextFilm, "; echo "Switch to YourNextGame"; @@ -312,7 +312,7 @@
  • Internet Explorer
  • Thank you for using YourNextRead

    - \"YourNextRead\"/ + \"YourNextRead\"/ "; if($iPhone && !$iPad) {