Вход Регистрация
Файл: youfone/ZAk/enter.inc.php
Строк: 45
<?php
//сессии нах =)
session_start();
if(empty(
$_SESSION['time'])) 
    
$_SESSION['time'] = time() + 1800;

if(
$_SESSION['time'] < time()) 
    
session_destroy();

//эмуляция сессий =)
 
$pass='asdasdas';
$_enter=false;
$_zapros="?";
$_SESSION['time'] = time() + 1800;

$login '';
$password '';
If (isset(
$_SESSION['pwd']) and !isset($_GET['login']))
{

    
$login=$_SESSION['lg'];
    
$password=$_SESSION['pwd'];
    

}
else
{
    if (!isset(
$_GET['login']) || !isset($_GET['password'])) 
    {
    
    }
    else
    {
        
$login=$_GET['login'];
        
$password=$_GET['password'];
    }
}
//аутентификация
$result=@mysql_query("SELECT * FROM `admin` WHERE `nick`='".$login."' and pass='".$password."'");
If (
mysql_num_rows($result)==1
{
    
$_SESSION['lg'] = $login;
    
$_SESSION['pwd'] = $password;

    if(isset(
$_GET['login']) and isset($_GET['password']) and
    
$_SESSION['lg'] == @$_GET['login'] and $_SESSION['pwd'] == @$_GET['password']) 
    
header('location: admin.php?mode=avtoriz');
    
    
mysql_data_seek($result,0);
    
$_USER=mysql_fetch_array($result);
    
$_enter=true;
    
$_zapros='?';
}
If (!
defined("anybody")){
If (!
$_enter){
//выбрасываем на вход,если не авторизован =)
include_once "head.php";
echo 
'<center><form action="" method="get"><br/>
Логин:<br/>
<input type="text" name="login" class="do_button" maxlength="20" value=""/><br/>
Пароль:<br/>
<input type="password" name="password" class="do_button" maxlength="15" value=""/><br/>
<input type="submit" class="button" value="Вход" />
</center>'
;
exit();


}
}
//типо конец =)
// (с) Magnat
?>
Онлайн: 1
Реклама