View file xmyx.ru/away.php

File size: 1.27Kb
<? 

include_once 'sys/inc/start.php'; 
include_once 'sys/inc/compress.php'; 
include_once 'sys/inc/sess.php'; 
include_once 'sys/inc/home.php'; 
include_once 'sys/inc/settings.php'; 
include_once 'sys/inc/db_connect.php'; 
include_once 'sys/inc/ipua.php'; 
include_once 'sys/inc/fnc.php'; 
include_once 'sys/inc/user.php'; 

$set['title'] = 'Переход на другой ресурс'; 

include_once 'sys/inc/thead.php'; 

shapka_VK(true, '/', 'Отмена'); 

if (!isset($_GET['to']) || (mysql_result(mysql_query("SELECT COUNT(*) FROM `rekl` WHERE `id` = '".intval($_GET['to'])."'"),0)==0 && !preg_match('#^https?://#',@base64_decode($_GET['to'])))) 
{ 
header("Location: /?".SID); 
exit; 
} 
 
if (preg_match('#^(ht|f)tps?://#',base64_decode($_GET['to']))) 
{ 
if (isset($_SESSION['adm_auth']))unset($_SESSION['adm_auth']); 
header("Location: ".base64_decode($_GET['to'])); 
exit; 
} 
else 
{ 
$rekl=mysql_fetch_assoc(mysql_query("SELECT * FROM `rekl` WHERE `id` = '".intval($_GET['to'])."'")); 
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]"); 
 
header("Location: ".base64_decode($_GET['to']));  
} 
include_once 'sys/inc/tfoot.php'; 
?>