hey thanks for the tip about the password, it is change, it just slipped my mind. lol. but thanks anyways, also i tried your idea, but keep getting a error message.
heres the php code if you want to take a look at that, or if that helps...
<?php
session_cache_limiter('public');
require_once( "File.php" );
require ("signupconfig.php");
if (!class_exists(auth))
{
include ("./auth.php");
}
include ("./authconfig.php");
include ("./check.php");
$dDir = realpath(dirname(__FILE__)."/../../downloads") . "/";
$dFile = $dDir . $_GET["file"];
$downloadValid = false;
if ($check["team"] == "paid") { // always allow downloads for paid users
$downloadValid = true;
} else { // check the limit for free users
// check the period limit
$qSetup = mysql_query("SELECT * FROM downloadsetup WHERE active = 1");
$row = mysql_fetch_array($qSetup);
if (sizeof($row) == 0) {
// just get the first one
$qSetup = mysql_query("SELECT * FROM downloadsetup");
$row = mysql_fetch_array($qSetup);
}
$period = $row["period"];
$units = $row["units"];
$maxdownloads = $row["amount"];
$now = time();
// now to determine if the timeframe needs to be set
$q = mysql_query("SELECT * FROM downloads WHERE user_id = {$check["id"]}");
$num_rows = mysql_num_rows($q);
if ($num_rows == 0) $createrow = true;
// is the timeframe still valid?
$timeframeValid = false;
if (!$createrow) {
$q = mysql_query("SELECT * FROM downloads WHERE enddate < {$now}");
$num_rows = mysql_num_rows($q);
if ($num_rows == 0) $timeframeValid = true;
}
if (!$timeframeValid) {
// set up new timeframe
$startdate = mktime(0, 0, 0, date("m"), date("d"), date("Y"));
switch ($units) {
case "D":
$enddate = mktime(0, 0, 0, date("m"), date("d")+$period, date("Y"));
break;
case "W":
$enddate = mktime(0, 0, 0, date("m"), date("d")+($period*7), date("Y"));
break;
case "M":
$enddate = mktime(0, 0, 0, date("m")+$period, date("d"), date("Y"));
break;
case "Y":
$enddate = mktime(0, 0, 0, date("m"), date("d"), date("Y")+$period);
break;
}
if ($createrow) {
// add first timeframe
$query = "INSERT INTO downloads (user_id, startdate, enddate, count, maxcount)
VALUES ('{$check["id"]}', '$startdate', '$enddate',0,$maxdownloads)";
} else {
// reset the last timeframe
$query = "UPDATE downloads SET startdate = $startdate, enddate = $enddate, count = 0, maxcount = $maxdownloads
WHERE user_id = {$check["id"]}";
}
$q = mysql_query($query);
}
//print date("d-m-Y",$startdate) . " - " . date("d-m-Y",$enddate);
// get the downloads and the downloadlimit
$q = mysql_query("SELECT maxcount, count, overridedownloads FROM downloads WHERE user_id = {$check["id"]}");
$row = mysql_fetch_array($q);
if ($row["overridedownloads"] != 0) {
if ($row["count"] < $row["overridedownloads"]) {
$downloadValid = true;
$addcount = true;
}
} else {
if ($row["count"] < $row["maxcount"]) {
$downloadValid = true;
$addcount = true;
}
}
}
if (is_file($dFile)) {
if ($downloadValid) {
if ($addcount) {
$query = "UPDATE downloads SET count = count+1 WHERE user_id = {$check["id"]}";
$countdownload = mysql_query($query);
} else {
$countdownload = true;
}
if ($countdownload) {
// give the file
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Content-Type: application/force-download");
header( "Content-Disposition: attachment; filename=".basename($dFile));
header( "Content-Description: File Transfer");
@readfile($dFile);
} else {
print "An error occured during the download";
}
} else {
header("Location: download.limit.html");
}
} else {
print "The file you looking for deos no exist. Go back and try again.";
}
?>
also the place where i get the error message (the first one) on theses 6 lines...
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Content-Type: application/force-download");
header( "Content-Disposition: attachment; filename=".basename($dFile));
header( "Content-Description: File Transfer");
so any ideas not? would it work if i just take of the "header"
let me know. thanks.