Файл: pages/rewrite_out.php
Строк: 25
<?php # Created by Up
include_once '../sistem/start.php';
include_once $config['OTS'].'sistem/config.php';
//include_once $config['OTS'].'sistem/function.php';
include_once $config['OTS'].'sistem/db.php';
//include_once $config['OTS'].'sistem/users.php';
if(isset($_GET['id']))
 {
    $id=((int)abs($_GET['id']));
    if(mysql_num_rows($sql=mysql_query('SELECT * FROM `site` where `id`=''.$id.'' LIMIT 1;'))>=1)
     {
        $arr=mysql_fetch_assoc($sql);
        if(!isset($_SESSION['go_site_'.$id]) and !isset($_COOKIE['go_site_'.$id]))
         {
            $_SESSION['go_site_'.$id]=1;
            SetCookie('go_site_'.$id,1,time()+60*15);
            mysql_unbuffered_query('UPDATE `site` SET `s_top`=''.($arr['s_top']+1).'',`vsego_s_top`=''.($arr['vsego_s_top']+1).'' WHERE `id`=''.$id.'' LIMIT 1;');
         }
        header('location: http://'.$arr['url']);
        exit;
     }
 }
#else
     {
        header('location: '.$config['home'].'/?act=error&error=404');
        exit;
     }
?>