Просмотр файла guest/admin.php

Размер файла: 1.65Kb
<?php
session_start();
header ("Content-type: text/html; charset=utf-8");
Header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
Header("Cache-Control: no-cache, must-revalidate");
Header("Pragma: no-cache");
Header("Last-Modified: ".gmdate("D, d M Y H:i:s")."GMT");
print "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">
<html>
<head>
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">
<link rel=\"stylesheet\" type=\"text/css\" href=\"./css.txt\">
<title>Админка</title>
</head>
<body>";
 include_once('./config.php'); 

print '<div class="in"><b>Админка</b></div>';
print '<div class="out"></div>';

print '<div class="messin">'; 
if(!empty($_POST['login']) && !empty($_POST['pass']))
{
$login=str_replace("'","`",$_POST['login']);
$login=mysql_escape_string($login);

$pass=str_replace("'","`",$_POST['pass']);
$pass=mysql_escape_string($pass);


 $result = mysql_query("SELECT * FROM `adminlog` WHERE `login`= '$login' AND `pass` ='$pass';");
 if (mysql_num_rows($result) != FALSE)
 {
$_SESSION['login']=$login;
$_SESSION['pass']=$pass;

print 'Добро пожаловать,админ<br>';
 print '<a href="./?">В гостевую</a><br>';

 }
}

print "<form method=\"post\" action=\"./admin.php?\">
*Login:<br>
<input type=\"text\" name=\"login\" maxlength=\"10\" size=\"15\"><br>
*Pass:<br>
<input type=\"text\" name=\"pass\" maxlength=\"10\" size=\"15\"><br>
<input style=\"margin-top:3px;\" type=\"submit\" value=\"Добавить\"></form>";

print '</div>';

print '<div class="out"></div>';
print '<div class="in"><b>&#169; wapt</b></div>';
print '</body></html>';
?>