php require_once public_sys class DB php require_once public_sys heade

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<?php
require_once('../public_sys/class.DB.php');
require_once('../public_sys/header.php');
verh('Авторизация GearNET');
if (isset ($b)) {
header ('location: /');
exit;
}
echo '<table width="100%" cellpadding="4" cellspacing="0" border="0" class="forumline">
<tr><td class="catSides">Войти на сайт<br/></td></tr></table>';
if (isset ($_GET['login'])) {
$_POST['email'] = htmlspecialchars (addslashes ($_POST['email']));
$_POST['pass'] = htmlspecialchars (addslashes ($_POST['pass']));
if (!isset ($_POST['email']) || !isset ($_POST['pass'])) {
echo '<div class="error">Неправильный Email или пароль!</div>';
}
else {
$query = DB :: $dbs -> query ("SELECT * FROM `blogger` WHERE `email`=? AND `pass`=?", array ($_POST['email'], md5 ($_POST['pass'])));
if ($query -> rowCount () == 0) {
echo '<div class="error"><b style="color:red;">Неправильный Email или Пароль!</b></div>';
} else {
$b = $query -> fetch ();
setcookie ('pass', $b['pass'], time () + 86400 * 365, '/');
setcookie ('id', $b['id'], time () + 86400 * 365, '/');
header ('location: /public_forum');
}
}
} else {
echo '<div class="row_hard">';
echo '<form method="post" action="?login">';
echo 'Ваш email:<br/> <input type="text" name="email" id="input-nick" placeholder="Ваш email" required maxlength="30"><br/>';
echo 'Ваш пароль:<br/> <input type="password" name="pass" id="input-pass" placeholder="Ваш пароль" required maxlength="30"><br/>';
echo '<input type="submit" value="Войти" />';
echo '</form>';
echo '</div>';
echo '<table width="100%" cellpadding="4" cellspacing="0" border="0" class="forumline">
<tr><td class="row1"><img class="ico" width="22" height="22" src="/templates/imagick/title_img.png" alt="" /><a href="/public_user/registr.php">&nbsp; Регистрация</a></td></tr>
<tr><td class="row1"><img class="ico" width="22" height="22" src="/templates/imagick/title_img.png" alt="" /><a href="/public_user/repass.php">&nbsp; Восcтановление пароля</a></td></tr></table>';
}
echo '<div class="catSides">< -&nbsp;<a href="/public_forum/index.php">На главную</a></div>';
require_once('../public_sys/footer.php');
?>