Файл: go.php
Строк: 31
<?php
/* DCMS Special
 * Дата последнего редактирования 28.12.2015
 * Модифицировал densnet
 */
foreach (array('start', 'compress', 'sess', 'settings', 'db_connect', 'ipua', 'fnc', 'user') as $inc) {
    require_once "sys/inc/$inc.php";
}
$set['title'] = 'Перенаправление';
require_once H . 'sys/inc/thead.php';
if (!isset($_GET['go']) || (mysql_result(mysql_query("SELECT COUNT(*) FROM `rekl` WHERE `id` = '" . intval($_GET['go']) . "'"), 0) == 0 && !preg_match('#^https?://#', @base64_decode($_GET['go'])))) {
    header("Location: index.php?" . SID);
    exit;
}
if (preg_match('#^(ht|f)tps?://#', base64_decode($_GET['go']))) {
    if (isset($_SESSION['adm_auth'])) {
        unset($_SESSION['adm_auth']);
    }
    header("Location: " . base64_decode($_GET['go']));
    exit;
} else {
    $rekl = mysql_fetch_assoc(mysql_query("SELECT * FROM `rekl` WHERE `id` = '" . intval($_GET['go']) . "'"));
    mysql_query("UPDATE `rekl` SET `count` = '" . ($rekl['count'] + 1) . "' WHERE `id` = '" . $rekl['id'] . "'");
    if (isset($_SESSION['adm_auth'])) {
        unset($_SESSION['adm_auth']);
    }
    header("Refresh: 2; url=$rekl[link]");
    echo "За содержание рекламируемого ресурса<br />n";
    echo "администрация сайта " . strtoupper($_SERVER['HTTP_HOST']) . " ответственности не несёт.<br />n";
    echo "<b><a href='$rekl[link]'>Переход</a></b><br />n";
    echo "Переходов: $rekl[count]<br />n";
}
require_once H . 'sys/inc/tfoot.php';