Вход Регистрация
Файл: rusikanlove/rusikanlove/autolog.php
Строк: 25
<?php


include_once"template/session.php";
include_once
"ini.php";
//АВТОРИЗАЦИЯ ПОСЛЕ РЕГИСТРАЦИИ
 
if(($_GET['id']!="")&&($_GET['ps']!="")){
  if(
preg_match('#^[0-9]{1,10}$#',$_GET['id'])){
    
$id $_GET['id'];
    
$ps $_GET['ps'];
       
$query mysql_query("SELECT login,pass,level FROM `user` WHERE id='$id'");
    
$result mysql_num_rows($query);
   if(
$result!="0"){
     
$arr mysql_fetch_array($query);
     
$pass $arr['pass'];
    if(
$ps==$pass){
      
$_SESSION['id']=$id;
      
$_SESSION['auth']=1;
      
$ua htmlspecialchars(addslashes($_SERVER['HTTP_USER_AGENT']));
      
$ip htmlspecialchars(addslashes($_SERVER['REMOTE_ADDR']));
      
mysql_query("UPDATE user SET time='$time', online='1', lastdate=CURRENT_TIMESTAMP(),ua='$ua',
                   ip='
$ip', regdate=CURRENT_TIMESTAMP() WHERE id='$id'");
      
header('Location: menu.php?'.sid.'');
      exit;
    } else { 
session_destroy(); header('Location: index.php'); exit; }
   } else { 
session_destroy(); header('Location: index.php'); exit; }
  } else { 
session_destroy(); header('Location: index.php'); exit; }
 } else { 
session_destroy(); header('Location: index.php'); exit; }
?>
Онлайн: 0
Реклама