View file dc/load.php

File size: 1.22Kb
<?php
include '../system/start.php';
#скачивание
$u=fint($_GET[id]);

  $udata=@mysql_fetch_array(mysql_query("SELECT * FROM `dc_urls` WHERE `id`='$u' LIMIT 1;"));
  $fdata=@mysql_fetch_array(mysql_query("SELECT * FROM `dc_files` WHERE `id`='$udata[f]' LIMIT 1;"));
  $ddata=@mysql_fetch_array(mysql_query("SELECT * FROM `dc_dir` WHERE `id`='$fdata[d]' LIMIT 1;"));
  if(empty($udata[id])) myheader("/");

  //подчсет кол-ва скачиваний
#добавить фильтр поисковиков
if (bot($user[ua])==false){
@mysql_query("UPDATE `dc_urls` SET `load`=`load`+1 WHERE `id`='$udata[id]';");
@mysql_query("UPDATE `dc_files` SET `load`=`load`+1 WHERE `id`='$fdata[id]';");
$ft=@fopen($_SERVER[DOCUMENT_ROOT].'/load.log','a+');
@fwrite ($ft,date('H:i:s')." - $udata[url] - $user[ua]\n");
@fclose($ft);

}
$url=$ddata[url].'/'.$fdata[url].'/'.$udata[url];
//jad
if(isset($_GET[jad])){
  $url=preg_replace('~[.]jar$~iu','.jad',$url);
  $udata[size]=filesize($url);
}

header('Content-type: '.mime($url).';');
header('Content-Length: '.$udata[size].';');
header('Content-Disposition: attachment; filename="'.$udata[url].'";');
$file=file_get_contents($url);
print $file;


exit();
?>