View file logout.php

File size: 1.01Kb
<?php
/**********************************************/
/* Автор скрипта: Александр Есин              */
/* E-Mail: [email protected] ([email protected]) */
/* ICQ: 6464729                               */
/* Site: http://ticlove.ru                    */
/**********************************************/
?>
<?php define ('SECURED', true); ?>
<?php require (dirname(__FILE__).'/_inc/sql.php'); ?>
<?php require (dirname(__FILE__).'/_inc/config.php'); ?>
<?php require (dirname(__FILE__).'/_inc/function.php'); ?>
<?php
	 if (!isset($_SESSION['auth_id']))
	 {
	      header('Location: /');
	      exit;
	 }
	 
	 mysql_query("UPDATE `q_users` SET `online` = '".(time() - (ONLINE_TIME + 1))."' WHERE `id_user` = '".$_SESSION['auth_id']."';");
	 
	 $date_end = (time() - (3600 * 24 * 365));
	 setcookie('auth_id', $id, $date_end, '/', $_SERVER["HTTP_HOST"]);
	 setcookie('auth_pass', $p, $date_end, '/', $_SERVER["HTTP_HOST"]);
	 
	 session_unset();
	 session_destroy();
	 header('Location: /index.php');
	 exit;
?>