Código PHP:
function getit($lid) {
global $prefix, $db;
$lid = intval($lid);
$db->sql_query("update ".$prefix."_downloads_downloads set hits=hits+1 WHERE lid='$lid'");
update_points(17);
$result = $db->sql_query("SELECT url FROM ".$prefix."_downloads_downloads WHERE lid='$lid'");
list($url) = $db->sql_fetchrow($result);
Header("Location: $url");
}
Código PHP:
function getit($lid) {
global $prefix, $db;
$lid = intval($lid);
$db->sql_query("update ".$prefix."_downloads_downloads set hits=hits+1 WHERE lid='$lid'");
update_points(17);
$result = $db->sql_query("SELECT url FROM ".$prefix."_downloads_downloads WHERE lid='$lid'");
list($url) = $db->sql_fetchrow($result);
header ("Content-Type: application/force-download");
header ("Content-Disposition: attachment;");
header ("Content-Transfer-Encoding: binary");
header ("Content-Length: ".filesize($url));
readfile($url);
}