Файл: load.php
Строк: 19
<?php
// mod Gemorroj
require 'moduls/config.php';
###############Проверка переменных###############
$id = int($_GET['id']);
###############Получаем инфу о файле###########
if($setup['adv_link'] > 0){
$kol = $f = trim(file_get_contents('moduls/cache/adv_link.dat'));
file_put_contents('moduls/cache/adv_link.dat',$kol+1);
if($setup['adv_link'] == $f){
file_put_contents('moduls/cache/adv_link.dat',0);
$q=mysql_query("SELECT `http`,`id` FROM `reklames` WHERE `stat`='2' ORDER BY RAND() LIMIT 1",$mysql);
$data=mysql_fetch_row($q);
mysql_query("UPDATE `reklames` SET `kolls`=`kolls`+1 WHERE `id`='".int($data[1])."'",$mysql);
header('Location: '.$data[0]); exit;}
}
$d = mysql_result(mysql_query('SELECT `path` FROM `files` WHERE `id` = ' . $id, $mysql), 0);
if (file_exists($d)) {
mysql_query('UPDATE `files` SET `loads` = `loads` + 1, `timeload` = ' . $_SERVER['REQUEST_TIME'] . ' WHERE `id` = ' . $id, $mysql);
$dir = dirname($_SERVER['PHP_SELF']);
$dir = ($dir == DIRECTORY_SEPARATOR ? '' : $dir);
header('Location: http://' . $_SERVER['HTTP_HOST'] . $dir . '/' . str_replace('%2F', '/', rawurlencode($d)), true, 301);
} else {
echo $setup['hackmess'];
}
?>