-
Notifications
You must be signed in to change notification settings - Fork 0
/
login.php
128 lines (114 loc) · 2.67 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>Log In</title>
<link rel="icon" href="favicon.ico" type="image/x-icon">
<!--<link rel="stylesheet" href="style/style.css">-->
<style>
body {
margin: 0px;
font-family: Calibri;
font-size: 14px;
height: 100%;
background-image: url(https://www.theindianwire.com/wp-content/uploads/2018/04/books.jpg);
}
div {
width: 600px;
margin: 60px auto;
padding: 50px 0px;
height: 500px;
border-radius: 50px;
color: rgba();
background-color: rgb(74,22,5);
}
form {
padding-left: 150px;
}
input {
border-radius: 20px 20px;
width: 250px;
height: 25px;
padding-left: 10px;
}
h1 {
text-align: center;
font-size: 60px;
color: white;
}
h1:hover{
text-shadow:0px 0px 20px black;
}
#lusername:hover,#lpassword:hover{
text-shadow:0px 0px 10px black;
}
input[type="submit"] {
height: 35px;
color: white;
background: rebeccapurple;
border: solid #3f3fdf;
font-size: 25px;
margin-top: 40px;
text-transform: uppercase;
}
h5 {
font-size: 25px;
text-decoration: none;
margin-left: 20px;
text-align: center;
color: white;
}
a {
text-decoration: none;
color: white;
font-size: 25px;
text-transform: uppercase;
margin-left: 250px;
}
a:hover {
text-shadow: 0px 0px 10px cyan;
color: blue;
}
@media screen and (max-width: 800px) {
form {
padding-left: 80px;
}
input {
width: 80%;
}
}
</style>
</head>
<body>
<?php /*include_once("template_pageTop.php");*/
error_reporting(0);
include_once('connect.php');
if($_SERVER["REQUEST_METHOD"]="POST")
{
$username=trim($_POST['username']);
$password=trim($_POST['password']);
$sql="SELECT username,password FROM users WHERE username='$username' and password='$password'";
$result = mysqli_query($conn,$sql);
$count = mysqli_num_rows($result);
if($count == 1)
{
session_start();
$_SESSION['username'] = $username;
header("location: index.php");
}
}
mysqli_close($conn);
?>
<div>
<h1>Login</h1>
<form action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]); ?>" method="post">
<input id="lusername" type"text" name="username" placeholder="Username"><br><br>
<input id="lpassword" type="password" name="password" placeholder="Password"><br><br>
<input type="submit" name="submit" value"Submit">
</form>
<?php echo $error; ?>
<br><h5>Not a member?</h5>
<a href="register.php">Register</a>
<br><br><a href="ref.html">Refer</a>
</body>
</html>