annoying error please help if you can

Hy All

Im here again to ask for you help. I still in the begining to launch the site, and i found a major error. The theory is the following. I planning to start a Pay per download site, which mean the members upload a file and when somebody want to download it, they have to fill a short survey. After survey done, both me and them get money. The problem is i test the script, and when i open the donwload link the page load, then immediately redirect and i get a following error “Stop trying to download without completing a survey.” which is an anti cheat message. Its 100% wrong because its appears all the time. i paste here the code, do you know why its appear straight after the page load? Its just appear for me on the Firefox.
[php] <?php
if (!isset($_GET[‘extra’])){
echo ‘’;
$path = $settings->getUploadPath();
$rand = mysql_real_escape_string($_GET[‘rand’]);
$sql = “SELECT * FROM conversions WHERE rand = ‘$rand’ and converted = ‘1’”;
$result = mysql_query($sql);
$row = mysql_fetch_assoc($result);
$file = $row[‘file_id’];
if($row[‘converted’] == ‘1’) {
if($row[‘downloaded’] == ‘0’) {
$path = $settings->getUploadPath();
$sql5 = “select * from uploads where id = ‘$file’”;
$row5 = $ado->fetch($ado->exec($sql5));
$sql6 = “UPDATE conversions SET downloaded = ‘1’ WHERE rand = ‘$rand’”;
header(“Pragma: public”);
header(“Expires: 0”);
header(“Cache-Control: must-revalidate, post-check=0, pre-check=0”);
header(“Cache-Control: public”);
header(“Content-Description: File Transfer”);
header(“Content-Type: application/force-download”);
header(“Content-Type: application/octet-stream”);
header(“Content-Type: application/download”);
header(“Content-Disposition: attachment; filename=”".$row5[‘hash’].""");
header(“Content-Transfer-Encoding: binary”);
header("Content-Length: ".filesize($path.$row5[‘hash’]));
} else {
echo ‘’;
} else {
echo ‘’;

Sponsor our Newsletter | Privacy Policy | Terms of Service