Mercurial > hg > ywww
changeset 40:77ff181476b8
geoip fix?, better debugging
author | Henry S. Thompson <ht@inf.ed.ac.uk> |
---|---|
date | Sun, 30 Jul 2017 05:36:07 -0400 |
parents | b78209a5fba1 |
children | 0578c6e438d3 |
files | geoiptest.php index.php xml/getAmazonInfo.php |
diffstat | 3 files changed, 7 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/geoiptest.php Sat Feb 18 15:18:47 2017 +0000 +++ b/geoiptest.php Sun Jul 30 05:36:07 2017 -0400 @@ -1,7 +1,7 @@ <html> <body> <?php -$country_name = apache_note("GEOIP_COUNTRY_NAME"); +$country_name = $_SERVER["GEOIP_COUNTRY_NAME"]; print "Country: " . $country_name; ?> </body>
--- a/index.php Sat Feb 18 15:18:47 2017 +0000 +++ b/index.php Sun Jul 30 05:36:07 2017 -0400 @@ -1,5 +1,5 @@ <?php - $country_code = apache_note("GEOIP_COUNTRY_CODE"); + $country_code = $_SERVER["GEOIP_COUNTRY_CODE"]; switch($country_code){ /* case "CA": Header( "HTTP/1.1 301 Moved Permanently" );
--- a/xml/getAmazonInfo.php Sat Feb 18 15:18:47 2017 +0000 +++ b/xml/getAmazonInfo.php Sun Jul 30 05:36:07 2017 -0400 @@ -64,10 +64,8 @@ //if(go != 1) //include "aws_signed_request.php"; - -$public_key ="AKIAJBXEHTNCU6LLFNIA"; -$private_key="Dgyv7aR6uGe3OtY95Dj6hHpDS/UEtyboMWpJchYA"; - +$public_key ="AKIAIHTNWC7L6LOUY4LQ"; +$private_key="zWQlIzndJDtXNfxEXH7K7YR7hzv3u77lOcqfqPde"; //for all parameters see if the user has overruled it or use the default foreach ($Adefault as $i=>$d) { $$i=isset($_GET[$i])?$_GET[$i]:$d; @@ -115,13 +113,13 @@ $xml = new SimpleXMLElement($output); $resName=$xml->getName(); $code=$xml->Error->Code; - file_put_contents('/var/ywww/debug/phpDebug',"Losing: $resName, $code\n",FILE_APPEND); + file_put_contents('/var/ywww/debug/phpDebug',"Losing (test): $resName, $code\n",FILE_APPEND); if ($code=='RequestThrottled') { usleep(200000); // Try to reduce throttling until we get a // principled solution in place } else { - file_put_contents('/var/ywww/debug/phpDebug',"parms: $go\n". + file_put_contents('/var/ywww/debug/phpDebug',"parms: $go\nurl: $url\n". print_r($parameters,TRUE)."\n",FILE_APPEND); if ($code=="") { file_put_contents('/var/ywww/debug/phpDebug',"error elt:\n$output\n",FILE_APPEND); @@ -427,7 +425,7 @@ [@attributes] => Array ( [Name] => AWSAccessKeyId - [Value] => AKIAJBXEHTNCU6LLFNIA + [Value] => AKIAIHTNWC7L6LOUY4LQ ) )