<?php
define('_IN_JOHNCMS', 1);
$headmod = 'getfile';
require_once '../incfiles/core.php';
require_once 'functions.php';

$name = $_GET['id'];
$file1 = mysql_query("SELECT * FROM `yuklemeler` WHERE `link` = '" . $name . "'");
$file = mysql_fetch_array($file1);


if(!$_SESSION['view'] == $file['id']){
$lik = mysql_result(mysql_query("SELECT `down` FROM `yuklemeler` WHERE `id` = '" . $file['id'] . "';"), 0);
$likk = $lik+1;
mysql_query("UPDATE `yuklemeler` SET `down` = '".$likk."' WHERE `id` = '".$file['id']."'");
}
$_SESSION['view'] = $file['id'];

if($file['cat'] == 1){
$cat = 'music';
}
if($file['cat'] == 2){
$cat = 'video';
}

header('location: /uploads/'.$cat.'/file/'.$file['url'].'');
?>