0) { $_SESSION ["affid"] = $affid; // Expire cookies in 10 years setcookie("affreferrer", $referringPage, time()+31536000, "/"); setcookie("affid", $affid, time()+31536000, "/"); } //'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' // '' // Redirect The Player '' // '' //'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' // There is a bug with PHP and IIS where a cookie will not get set if all you do is an HTTP Redirect // To get around this, we will use an HTML HTTP-EQUIV to do the redirect //////////////////////////////////////////////////////////////////////////////// /// DEBUG //////////////////////////////////////////////////////////////////////////////// //echo("Start Response:--" . $ResponseText . "--End--" . $getBannerInfoServer); //exit(); echo(""); if (strlen($RedirectLink) > 0) { echo(''); } elseif (strlen($ResponseText) > 0) { echo(''); } else { echo(''); } echo(""); exit(); function SendRequest($CasinoAidDownloadServer, $CasinoAidDownloadScript, $ip, &$affid, $qString) { /************************************************* * Steps: * - specify the domain you wish to connect to * - specify the file that you wish to request * do not forget the initial / before the file * - open connection to domain * - send the GET and Host header * - read the response from the file you requested * - parse the response: * - $pieces[0] -> headers returned * - $pieces[1] -> text displayed by request *************************************************/ $result = ""; // Used to build the response string $returnValue = ""; // Open the socket to the domain... $fp = fsockopen($CasinoAidDownloadServer, 80, $errno, $errstr, 30); if($fp) { // Send GET request, which specifies which file fwrite($fp, "GET $CasinoAidDownloadScript?redirectAsData=1&remoteIP=".urlencode($ip)."&".$qString." HTTP/1.0\r\n"); fwrite($fp, "Host: $CasinoAidDownloadServer\r\n\r\n"); // Receive the response... while(! feof($fp)) { $result .= fread($fp, 512); } fclose($fp); // Break up results... $pieces = explode("\r\n\r\n", $result); if ($pieces >=2) { $headers = $pieces[0]; $returnValue = $pieces[1]; // if ($affid != -1) { $header1 = explode("affid=", $headers ); if ($header1 >= 2) { $header2 = explode(";",$header1[1]); $affid = $header2[0]; } // } } } return $returnValue; } ?>