dara
Новичок
Дата регистрации:
24.04.2013 19:02:31
Сообщений: 7
Код:
Auth.php
?php
session_start();
require_once "../lib/functions.php";
if (checkUser($_SESSION["email"], $_SESSION["password"])) {
header("Location: /admin/index.php"
exit;
}
?>
start.php
?php
session_start();
require_once "../lib/functions.php";
if (!((checkUser($_SESSION["email"], $_SESSION["password"])) && (isAdmin($_SESSION["email"])))) {
header("Location: /admin/auth.php"
exit;
}
?>
index.php
<?php
require_once "start.php";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
</head>
<title>Admin-панель</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251" />
<link rel="stylesheet" type="text/css" href="styles/main.css"/>
</head>
<body>
<h1 id="header">Админ-панель</h1>
<h2>Меню</h2>
<p>
<a href="#">Добавить новую статью</a>
</p>
<p>
<a href="../logout.php">Выход</a>
</p>
</body>
</html>