Файл: load.php
Строк: 30
<?php
/**
* @author [FaNiska]
* @copyright 2009
* Загруз центр
* Предложения, идеи, вопросы и об ошибках писать в icq 65-64-538 или на mobi-m-ru@ya.ru
*/
include 'inc/db_connect.php';
include 'inc/function.php';
include 'inc/set.php';
$file_info = mysql_fetch_array(mysql_query('SELECT `s_name` FROM `' . $table . '` WHERE `id` = ' . $id . ' LIMIT 1'));
if (file_exists($file_info['s_name']))
{
mysql_query('UPDATE `' . $table . '` SET `count`=`count`+1, `lastload`=' . $time . ' WHERE `id`=' . $id . ' LIMIT 1');
$url = $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . '/' . $file_info['s_name'];
$url = str_replace('/', '/', $url);
header('Location: http://' . $url);
exit();
} elseif (eregi('http://', $file_info['s_name']))
{
mysql_query('UPDATE `' . $table . '` SET `count`=`count`+1, `lastload`=' . $time . ' WHERE `id`=' . $id . ' LIMIT 1');
header('Location: ' . $file_info['s_name']);
exit();
} else
{
header('Location: index.php');
}
?>