<?php
  ///////////////////////////////////////////////////
  // Выход из системы
  ///////////////////////////////////////////////////
$lang = substr($_SERVER["HTTP_ACCEPT_LANGUAGE"], 0,2);
 if(is_file ("../lang/".$lang.".php")) include "../lang/".$lang.".php";
   else include "../lang/ru.php";

require_once "../config.php";
if(!@mysql_select_db($dbname,$dbcnx))
  {
    echo("<p>At this moment database is not available, therefore correct display of page is impossible.<br />If you do not install project previously, run script <a href=install.php>http://".$_SERVER['SERVER_ADDR']."/personal/install.php</a></p>");
    exit();
  }

$query = "SELECT `login_id` FROM `tbl_logins` WHERE `login`='".$_COOKIE['login']."' ";
$result = mysql_query($query);
  if(!$result) puterror2($TEXT['error-tbl20']);
   $result2 = mysql_fetch_array($result);

mysql_query("DELETE FROM tbl_p_tmp WHERE `usr_id` = '".$result2['login_id']."' ");
setcookie("passwrd", "");
setcookie("ident", "");

echo "<html><head>
          <meta HTTP-EQUIV='Refresh' CONTENT='0; URL=index.php'>
          </head><body></body></html>";
?>