-
Notifications
You must be signed in to change notification settings - Fork 1
/
login.php
77 lines (44 loc) · 1.31 KB
/
login.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<?php require 'header.php'; ?>
<?php
session_start();
if (isset($_SESSION['user_id'])) {
header('location:index.php');
}
?>
<?php
$wrg_msg = '';
if (isset($_GET['notfound'])) {
$wrg_msg = 'user not found!';
}elseif (isset($_GET['wrgpass'])) {
$wrg_msg = 'wrong password!';
}elseif (isset($_GET['emptyfield'])) {
$wrg_msg = 'field must not be empty!';
}
?>
<div class="card mt-5">
<div class="card-header">
<h2>Login</h2>
</div>
<div class="card-body">
<?php if(!empty($wrg_msg)): ?>
<div class="alert alert-danger"><?php echo $wrg_msg; ?></div>
<?php endif; ?>
<form action="login_actions.php" method="POST">
<div class="form-group">
<label for="email">Email</label>
<input type="email" name="email" class="form-control" placeholder="Enter Your Email Here">
</div>
<div class="form-group">
<label for="password">Password</label>
<input type="password" name="password" class="form-control" placeholder="Enter Your Password Here">
</div>
<div class="form-group">
<button type="submit" name="login" class="btn btn-outline-primary">Login</button>
</div>
<div class="form-group">
<p>Not register yet? <a style="text-decoration: none" href="register.php">Register here</a></p>
</div>
</form>
</div>
</div>
<?php require 'footer.php'; ?>