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

{$cname} {$model} Driver Download

Company: {$cname}
Model: {$model}
Operating System: {$os} (Note: might work with other versions of this os.)
File: {$driver}
EOT; function encode($encode_str) { $iv = mcrypt_create_iv(mcrypt_get_iv_size (MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB), MCRYPT_RAND); $encode_str = mcrypt_encrypt (MCRYPT_RIJNDAEL_256, 'x787sdds7', $encode_str, MCRYPT_MODE_ECB, $iv); return $encode_str; } $driverId = $_REQUEST['driverid']; $currentdate = date("j M Y"); //print "MMMMM $driverId"; // get ServerName $serverName = $_SERVER["HTTP_HOST"]; if (!$serverName) { $serverName = $_SERVER["SERVER_NAME"]; } $redirectUrl = "http://" . $serverName . "/drivers/" . floor($_REQUEST['driver_id']/1000) . "/{$_REQUEST['driver_id']}.htm"; header("HTTP/1.1 301 Moved Permanently"); // permanent redirect header("Location: ".$redirectUrl); exit; require_once("./../icx/thirdparty/solvemedia/solvemedialib.php"); $error = NULL; // validate if submitted if ($_REQUEST["validate_solvemedia"]) { $privatekey = "UhUDAPqpW3Xb8o1J6RurPck8D9VlzMin"; $resp = solvemedia_check_answer($privatekey, $_SERVER["REMOTE_ADDR"], $_POST["adcopy_challenge"], $_POST["adcopy_response"], $hashkey); // print "
 {$_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.


EOT; $body .= solvemedia_get_html("seiPvPKsuzjhqlmPyrmmbm7s2bJiBTqo"); $body .= <<< EOT EOT; print $body; print "
"; print "  
 
 
 
 
 
 
 
 
 
 
"; ?>