error_reporting(0);
$file=$_GET['file'];
?>
Download
if (isset($file)) {
$link=mysql_connect("localhost","sawas","kinderiushka69") or die("Cannot connect to db...");
mysql_select_db("turnyras")or die("Cannot select db");
$query=("SELECT downloaded, file from downloaded where file=\"$file\"") or die("no files available");
$rezultatas=mysql_query($query);
$eile=mysql_fetch_array($rezultatas);
$file2=$eile['file'];
if ($file!=$file2) die ("no files available");
$downloaded=intval($eile['downloaded'])+1;
$query="UPDATE downloaded set downloaded=$downloaded where file=\"$file\"";
mysql_query($query);
mysql_real_escape_string($file);
echo "Your download will begin in a moment.";
echo "";
}
?>