connectSQL(); // load id $id = checkEscape($_REQUEST["id"]); $id = mysql_real_escape_string($id); // update our hit tracking table $sql = "INSERT INTO tracking(pid, ip, addate) VALUES ($id, '".$_SERVER["REMOTE_ADDR"]."', NOW() )"; $result = $myVCMS_DB->runStatement($sql); // get data about this add $sql = "select * from ads where id = $id"; $result = $myVCMS_DB->runStatement("SELECT * FROM ads where id = '$id'"); $row = mysql_fetch_assoc($result); $url = checkEscapeDecode($row["url"]); $enforce = checkEscapeDecode($row["enforce "]); // Update the hit counter if enforced if ($enforce == 2) { $sql = "update ads set curHits=curHits+1 where id = $id"; $result = $myVCMS_DB->runStatement($sql); } //redirects them to the link they clicked header("Location: $url"); ?>