вот код страницы авторизации:
<?php
include"blocks/db.php";
if(isset($_POST['enter']))
{
$e_login = $_POST['e_login'];
$e_password = md5($_POST['e_password']);
$query = mysql_query("SELECT * FROM login_form WHERE login = '$e_login'");
$login_form_data = mysql_fetch_array($query);
if($login_form_data['password'] == $e_password)
{
session_start();
$_SESSION['name'] = $e_login;
}
else
{
header('Location: error.php');
}
}
if(isset($_POST['logout']))
{
unset($_SESSION['name']);
}
if(isset($_SESSION['name']))
{
header('Location: admin/index.php');
}
else
{
echo '<br><form method="post" action="authorization.php">
<center style="font-size: 12px; font-family: Georgia;"><h3>Форма входа</h3><br>
<label style="font-size: 16px; font-family: Georgia;">Введите ваш логин:</label><br><br>
<input type="text" name="e_login" placeholder="| Ваш логин" required="" /><br><br>
<label style="font-size: 16px; font-family: Georgia;">Введите ваш пароль:</label><br><br>
<input type="password" name="e_password" placeholder="| Ваш пароль" required="" /><br><br>
<input style="font-size: 16px; font-family: Georgia;" type="submit" name="enter" value="Войти" />
</center>
</form>';
}
?>
а вот и код страницы входа в администраторскую часть:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Войти в администраторскую часть!</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<meta name="description" content=""/>
<meta name="keywords" content=""/>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body>
<?php include"blocks/design.php"?>
<?php include"blocks/menu.php"?>
<?php include"blocks/db.php"?>
<?php include"authorization.php"?>
</td>
<h3><center>Страница входа в базу данных</center><br></h3>
<td width="100%">
<br>
<?php include"registration.php"?>
</td>
</tr>
</table>
<h2> </h2>
</td>
</tr>
</table>
<div align="center"><p>
<a href="http://www.logodesignweb.com/">Logo design web</a>
| <a href="http://www.logodesignweb.com/webhostingguide/">web hosting guide</a>
| <a href="http://www.logodesignweb.com/stockphoto/">stock photos</a>
</p>
<br>
</div>
<div style="font-size: 0.8em; text-align: center; margin-top: 1.0em; margin-bottom: 1.0em;">
<a href="http://web-mastery.info/">Как сделать сайт</a>
</div>
</body>
</html>