lets pretend the file is in the folder( screen/test.exe)
And I have a download link as
Code: Select all
print "<a href="$screenlink">Download</a><br><br><br>\n";Thanks
Moderator: General Moderators
Code: Select all
print "<a href="$screenlink">Download</a><br><br><br>\n";Code: Select all
<?php
include("db.inc");
$getfromdb = mysql_query("SELECT downloads from q_downloads where ID='1'") or die ("error on first query");
$gety = mysql_fetch_array($getfromdb);
$new2 = $getyїdownloads] + 1;
$newdl = mysql_query("UPDATE q_downloads SET downloads='$new2' where ID='1'") or die ("error on second query!");
if(IsSet($file))
{
header("Location:http://$file");
}
?>Code: Select all
$query = "UPDATE table SET totaldownloads = totaldownloads + 1 WHERE file='$file'";
mysql_query($query);