View file admin/includes/auth.php

File size: 533B
<?php

include_once('includes/db.php');

session_start();

$users = mysql_query('SELECT login, password FROM admins WHERE id = 1');
$user = mysql_fetch_array($users, MYSQL_ASSOC);
if($user['login'] == '')
{
   header('Location: login.php');
   exit;
}

if(isset($_SESSION['login']) && isset($_SESSION['password']) && $_SESSION['login'] == $user['login'] && $_SESSION['password'] == $user['password'])
{
   // проверка прошла успешно - ничего не делаем
}
else
{
   header('Location: login.php');
   exit;
}

?>