Файл: exit.php
Строк: 19
<?php
/*
author: SBeka
http://masteram.us/id580
*/
include 'system/mysql.php';
include 'system/sys_func.php';
session_start();
    if (isset($_SESSION['user_id'])) {
        if (isset($_POST['yes'])) {
            unset($_SESSION['user_id']);
            setcookie('login', $user['login'], time()-600);
            setcookie('pass', $user['pass'], time()-600);
            mysql_query("UPDATE `users` SET `time_last` = ". (time()-600) ." WHERE `id` = '". $user['id'] ."' LIMIT 1");
            header("Location: /");
            exit;
        }
        
        include_once 'system/mysql.php';
        include_once 'system/sys_func.php';
        $title = 'Выход';
        include ('system/head.php');
        echo '<div class="title">Выход</div>
        <div class="c">Вы уверены что хотите выйти?</div>
        <form method="post">
        <input type="submit" name="yes" value="Да, я хочу выйти" /> <a href="/">Нет</a>
        </form>';
        foot();
    } else {
        header('Location: index.php');
        exit;
    }
?>