Код:
<?php
session_start();
include 'config.php';
$user=trim($_POST['user']);
$pass=trim($_POST['pass']);
if($_SESSION['log']===true)
{
echo '
<center>Влязохте в контролния панел :)</center>
';
}
else
{
if(strlen($user)>2 && strlen($pass)>2){
if($user && $pass)
{
$_SESSION['log']=true;
header('Location: index.php');
}
}
}
?>
<html>
<body bgcolor="cccccc">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251" />
<title>Katsarov</title>
</head><center>
<div style="background:#f2f2f2; width:250px; border:1px #999 solid">
<form action="index.php" method="post">
Потребител:<input type="text" name="user"><br>
Парола:<input type="text" name="pass"><br>
<input type="submit" value="Влез">
</form>
<input type="button" value="Регистрация"></div></center>
</body>
</html>