Файл: public_html/modules/auth.php
Строк: 48
<?php
require_once ('../core/base.php');
$header = 'Авторизация';
require_once ('../core/head.php');
trueauth();
if(isset($_REQUEST['success'])){
echo'<div class="b"><center>';
$name = fl($_POST['login']);
$pass = fl($_POST['password']);
$sql = $base -> query("SELECT `login`,`password` FROM `users` WHERE `login` = '".$name."' and `password`='".md5($pass)."' LIMIT 1") -> fetch_assoc();
if(empty($name)) error('Введите логин');
elseif(empty($pass)) error('Введите пароль');
elseif($sql == 0) error('Пользователь не найден');
else {
setcookie('login', $name, time()+86400*365, '/');
setcookie('password', md5($pass), time()+86400*365, '/');
header('location: /');
}
echo"</center></div>";
}
echo'
<link rel="stylesheet" type="text/css" href="/css/reset-1.css">
<link rel="stylesheet" type="text/css" href="/css/desig.css">
';
echo"<link href='https://fonts.googleapis.com/css?family=Oswald' rel='stylesheet' type='text/css'>
<body>";
echo'<div id="main" class="container">
<form name="loginform" id="loginform" action="#" method="post" class="wpl-track-me">
<p class="login-username">
<label for="user_login">Username</label>
<input type="text" name="login" id="user_login" class="input" placeholder="Логин" value="" size="20" />
</p>
<p class="login-password">
<label for="user_pass">Password</label>
<input type="password" name="password" id="user_pass" class="input" placeholder="Пароль" value="" size="20" />
</p>
<p class="login-submit"><input type="submit" name="success" id="wp-submit" class="button-primary" value="Войти" />
</p>
</form>
</div>';
?>
<?
echo'<div class = "line"></div><a class = "link" href = "/"><center>Назад</center></a>';
require_once ('../core/foot.php');
?>