-
Notifications
You must be signed in to change notification settings - Fork 0
/
login.php
80 lines (74 loc) · 1.82 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
75
76
77
78
79
80
<?php
include "init.php";
if(count($_POST) > 0)
{
$errors = User::action()->login($_POST);
if(!is_array($errors))
{
header('Location:index.php');
die;
}
}
?>
<html>
<head>
<title>Login form</title>
</head>
<style>
form{
margin:auto;
margin-top: 20px;
width: 100%;
max-width: 300px;
border-radius: 5px;
border: solid thin #ccc;
box-shadow: 0px 0px 10px #aaa;
font-family:Verdana, Geneva, Tahoma, sans-serif;
padding:10px;
position: relative;
}
input{
position: relative;
margin: auto;
width: 100%;
border-radius: 5px;
border: solid thin #ccc;
padding: 10px;
margin-top:5px;
}
select{
height: 41px;
width: 300px;
border: solid 1px #ccc;
padding: 7px;
border-radius: 5px;
}
.btn{
padding:10px;
border: none;
background-color:lightskyblue;
color:#fff;
cursor:pointer;
border-radius: 5px;
}
</style>
<body>
<form method="post">
<h1>Login</h1><br>
<div style="color:red; font-size:12px;">
<?php
if(isset($errors) && is_array($errors))
{
foreach($errors as $error){
echo $error. "<br>";
}
}
?>
</div>
<input type="email" class="input" name="email" placeholder="Enter Email" value="<?=isset($_POST['email']) ? $_POST['email'] : ''; ?>"><br><br>
<input type="password" class="input" name="password" placeholder="Enter Password" value="<?=isset($_POST['password']) ? $_POST['password'] : ''; ?>"><br><br>
<input class="btn" type="submit" value="Login"><br>
<br style="clear: both">
</form>
</body>
</html>