Размер файла: 1.39Kb
<?php
$title='Скачивание';
require"../system/config.php";
require"../system/func.php";
require"../system/head.php";
require"../system/error.php";
if(isset($_GET['id_file'])){$id_file=cifry($_GET['id_file']);}else{$id_file=0;}
if(isset($_GET['id_photo'])){$id_photo=cifry($_GET['id_photo']);}else{
$id_photo=0;}
if(isset($_GET['id_load'])){$id_load=cifry($_GET['id_load']);}else{$id_load=0;}
if(!empty($id_file)){
$ofile=mysql_query("select format from obmen_files where id_file='$id_file' limit 1");
}elseif(!empty($id_photo)){
$ofile=mysql_query("select * from photos where id_photo='$id_photo' limit 1");
}elseif(!empty($id_load)){$ofile=mysql_query("select * from load_files where id_file='$id_load' limit 1");}
if(mysql_num_rows($ofile)==0){echo'FATAL ERROR';}else{$sfile=mysql_fetch_array($ofile); if(!empty($id_file)){mysql_query("update obmen_files set loads=loads+1 where id_file='$id_file' limit 1");
header('Location: ../files/'.$id_file.'_'.$krsite.'.'.$sfile['format']);}elseif(!empty($id_photo)){mysql_query("update photos set loads=loads+1 where id_photo='$id_photo' limit 1");
header('Location: ../photos/'.$sfile['id_photo'].'_'.$sfile['id_user'].'_'.$krsite.'.'.$sfile['format']);} mysql_query("update load_files set loads=loads+1 where id_file='$id_load' limit 1");
header('Location:../load/'.$sfile['put'].'/'.$sfile['nastna'].'.'.$sfile['format'],true);}
?>