Файл: pages/apps/index.php
Строк: 44
<?
define('H', $_SERVER['DOCUMENT_ROOT'] . '/');
include_once H . 'sys/inc/start.php';
include_once H . 'sys/inc/compress.php';
include_once H . 'sys/inc/sess.php';
include_once H . 'sys/inc/settings.php';
include_once H . 'sys/inc/db_connect.php';
include_once H . 'sys/inc/ipua.php';
include_once H . 'sys/inc/fnc.php';
include_once H . 'sys/inc/user.php';
if (!$user)
{
$_SESSION['message'] = lang('Нужно авторизоваться');
exit(header("Location: /"));
}
$app = mysql_fetch_assoc(query("SELECT `name_lat`,`link`,`id` FROM `apps` WHERE `name_lat` = '". my_esc($_GET['app']) ."' or `id` = '". intval($_GET['app']) ."' LIMIT 1"));
if ($app['link'] != null)
{
query("UPDATE `apps` SET `count_aut` = '".($app['count_aut'] + 1)."' WHERE `id` = '".$app['id']."' LIMIT 1");
exit(header("Location: ".$app['link']));
}
else
{
$_SESSION['message'] = lang('Такой игры или приложения не обнаружено');
exit(header("Location: /user/apps"));
}