// BEGIN SEND to ClickThrusPHPBay database $recordurl = 'http://dunoonmugs.net/QCT2-1/RecordPHPBayClicks.php'; $QCTUsername = 'scootersmom1970'; $QCTPassword = 'ttdx19aZr@11'; if ( isset($_SERVER['HTTP_HOST']) ) { $thehost = strtolower(str_replace('http://','',$_SERVER['HTTP_HOST'])); $thehost = str_replace('www.','',$thehost); } else { $thehost = ''; } $ip = isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : ''; $useragent = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : ''; $thedbreferer = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : ''; $thecountry = isset($rover["abbr"]) ? $rover["abbr"] : ''; $theitemtitle = isset($ktv["title"]) ? $ktv["title"] : ''; $fields = array( 'Site'=>urlencode($thehost), 'CampID'=>urlencode($ktv["pid"]), 'CustomID'=>urlencode($ktv["cid"]), 'ItemNum'=>urlencode($ktv["item"]), 'IP'=>urlencode($ip), 'Referer'=>urlencode($thedbreferer), 'UserAgent'=>urlencode($useragent), 'theurl'=>urlencode($url), 'thecountry'=>urlencode($thecountry), 'theitemtitle'=>urlencode($theitemtitle), ); $fields_string = array(); foreach($fields as $key=>$value) { $fields_string[] = $key.'='.$value; } $fields_string = implode('&',$fields_string); $ch = curl_init(); curl_setopt($ch,CURLOPT_URL,$recordurl); if ( strlen($QCTUsername) > 0 && strlen($QCTPassword) > 0 ) { curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY); curl_setopt($ch, CURLOPT_USERPWD, "$QCTUsername:$QCTPassword"); } curl_setopt($ch,CURLOPT_POST,count($fields)); curl_setopt($ch,CURLOPT_POSTFIELDS,$fields_string); $result = curl_exec($ch); curl_close($ch); // END SEND to ClickThrusPHPBay database header("Location: " . $url, true, 301); exit; } } ?>