require_once(dirname(__FILE__)."/../camera/icx/db/instantiate.php"); require_once(dirname(__FILE__)."/../camera/icx/general/general.inc.php"); require_once(dirname(__FILE__)."/../camera/icx/qtemplate/QTemplate.class.php"); //require_once(dirname(__FILE__)."/../camera/icx/general/ObjectCache.class.php"); require_once(dirname(__FILE__)."/../cgi-bin/cdrom_vars.php"); $driverId = $_REQUEST['driverid']; $drvarray["db_id"]=$driverId; $sql = "SELECT company.id AS companyid, cname,model,osid AS os,driver,driverdb2.comments, DATE_FORMAT(dated,'%b %e, %Y') AS datedd FROM driverdb2, company WHERE company.id=driverdb2.companyid AND deviceid=$drvarray[device_id] AND (record_type='Driver' OR record_type='Firmware' OR record_type IS NULL) AND is_visible=1 AND driverdb2.id=$drvarray[db_id] "; $result=$icxDb->query($sql) or die ("Invalid query: mysql_error()2"); $item= $icxDb->fetch_array($result); $drvarray["company_id"]=$item[companyid]; if ($item[cname]!="") { $drvarray["cname"]=$item[cname]; } else { $drvarray["cname"]=" "; } if ($item[model]!="") { $drvarray["model"]=$item[model]; } else { $drvarray["model"]=NULL; } if ($item[os]!="") { $drvarray["os"]=$item[os]; } else { $drvarray["os"]=" "; } if ($item[driver]!="") { $drvarray["driver"]=$item[driver]; } else { $drvarray["driver"]=" "; } $cname = $item[cname]; $model = $drvarray["model"]; $os = $drvarray["os"]; $driver = $drvarray["driver"]; $driverInfo = <<< EOT
{$_POST["adcopy_challenge"]}, {$_POST["adcopy_response"]}
"; // print_r($resp); if (!$resp->is_valid) { $error = "The question wasn't answered correctly. Please try again."; } else { // determine the correct x-drivers site $xServerName = str_replace("drivers","Drivers",ucfirst(str_replace("www.","",$serverName))); // get expire time for md5 encoding $encodedArray = array(); $now = date('U'); $expireMins = 20; // user has 20 minutes to download their driver $expireTime = $now + ($expireMins*60); $encodedArray['expireTime'] = $expireTime; $encodedArray['driverid'] = $driverId; $encodedArray['xs'] = $xServerName; $cc = serialize($encodedArray); $encodedCode = urlencode(base64_encode(encode(base64_encode($cc)))); $url = "http://www.driverguide.com/driver/detail.php?driverid={$driverId}&xdl=1&action=download&expcode={$encodedCode}"; header("Location: ".$url); exit; } } // determine the correct site name for header title $xServerNameTitle = str_replace("-drivers"," Driver",ucfirst(str_replace("www.","",str_replace(".com","",$serverName)))); $xServerShortName = str_replace("-drivers","",strtolower(str_replace("www.","",str_replace(".com","",$serverName)))); $body = <<< EOT{$xServerNameTitle} Download
$currentdate {$driverInfo}
{$error}To Download the file, please prove that you are human by solving the puzzle below.
You are not signing up for anything by doing this.