<?php session_start(); ?>
<?php
include("stop.php");
include('config.php');

$id = $_GET['id'];
$sql = mysql_query("SELECT * FROM fisiere where id = $id ");
$row = mysql_fetch_array($sql);
$file = $row['file'];
$ftype = $row['ftype'];
$dir = "uploads/$ftype";
$dload = $row['download'] + 1;
$sz = $row["size"];

$time = date("d.m.Y, H:i:s");
mysql_query("UPDATE fisiere SET lastaccess='$time' WHERE id='$id'");
mysql_query("UPDATE fisiere SET download = $dload WHERE id = $id ");
header("Location: $dir/$file");
?>