diff --git a/php/go.php b/php/go.php index 04cdf1d..01fc9f1 100644 --- a/php/go.php +++ b/php/go.php @@ -6,7 +6,7 @@ **/ - if (isset($_GET['k'])) { + if (isset($_GET['k'])) { // Mandatory Component 1 - The clients secret salt. $ClientSalt = $_GET['k']; settype($ClientSalt, "string"); @@ -14,10 +14,10 @@ } - if (isset($_GET['dhcp'])) { + if (isset($_GET['dhcp'])) { // Optional Component - The clients IP Address $dhcpPreference = $_GET['dhcp']; - settype($dhcpPreference, "integer"); + settype($dhcpPreference, "integer"); // numbers only, 1 = on ... anything else = off. if ($dhcpPreference = 1) { @@ -35,17 +35,22 @@ } if (!$DHCP) { - if (getenv(HTTP_X_FORWARDED_FOR)) { - $IP = getenv(HTTP_X_FORWARDED_FOR); + if (getenv(HTTP_X_FORWARDED_FOR)) { // Proxy Server Detection/ + $IP = getenv(HTTP_X_FORWARDED_FOR); // Proxy } else { - $IP = getenv(REMOTE_ADDR); + $IP = getenv(REMOTE_ADDR); // No Proxy. } } + + // Mandatory Component 2 - The Clients User Agent String. $UserAgent = getenv(HTTP_USER_AGENT); $Numbers = array("1", "2", "3", "4", "5", "6", "7", "8", "9", "0"); - $UserAgent = str_replace($Numbers, '', $UserAgent); + $UserAgent = str_replace($Numbers, '', $UserAgent); // We strip version numbers to produce the same results after upgrades. + + + // Output. header("Content-Type: text/plain"); echo "$ClientSalt \n";