<?








include_once 'sys/inc/start.php';








include_once COMPRESS;








include_once SESS;








include_once 'sys/inc/home.php';








include_once SETTINGS;








include_once DB_CONNECT;








include_once IPUA;








include_once FNC;








include_once USER;

















$set['title']='Перенаправление';








include_once THEAD;








title();

















if (!isset($_GET['go']) || (dbresult(dbquery("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=dbassoc(dbquery("SELECT * FROM `rekl` WHERE `id` = '".intval($_GET['go'])."'"));








dbquery("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";








}








include_once TFOOT;








?>