-
Notifications
You must be signed in to change notification settings - Fork 0
/
auth.php
51 lines (38 loc) · 1.31 KB
/
auth.php
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
<?php
if (isset($_GET['exit'])) {
setcookie('auth', false, 1);
}
if ($_POST['email'] == '[email protected]' && $_POST['password'] == '123') {
$_COOKIE['auth'] = true;
setcookie('auth', true);
} elseif (!empty($_POST)) {
$message = 'Неправильно введен логин или пароль';
}
if (isset($_COOKIE['auth'])) {
header('Location: /');
exit;
}
?>
<!DOCTYPE html>
<html lang="en">
<?php include 'includes/head.php' ?>
<body>
<?php include 'includes/header.php'; ?>
<div class="container">
<?php include 'includes/message.php' ?>
<form method="POST">
<div class="form-group">
<label for="exampleInputEmail1">Email address</label>
<input type="email" name="email" class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp" placeholder="Enter email">
<small id="emailHelp" class="form-text text-muted">We'll never share your email with anyone else.</small>
</div>
<div class="form-group">
<label for="exampleInputPassword1">Password</label>
<input type="password" name="password" class="form-control" id="exampleInputPassword1" placeholder="Password">
</div>
<button type="submit" class="btn btn-primary">Submit</button>
</form>
</div>
<?php include 'includes/footer.php'; ?>
</body>
</html>