-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathindex.php
More file actions
189 lines (126 loc) · 4.85 KB
/
Copy pathindex.php
File metadata and controls
189 lines (126 loc) · 4.85 KB
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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
<?php
include 'session_home.php';
include 'includes/autoloader.inc.php';
include 'functions.php';
$users = new Users;
$errormsg = "";
$infomesg = "";
if(isset($_POST['loginnow'])){
$email = cleaninput($_POST['email']);
$password = cleaninput($_POST['password']);
/*
*
*/
if($users->Query("SELECT * FROM users WHERE email = ?", [$email])){
if($users->CountRows() > 0){
$row = $users->Single();
$password_real = decryptdata($row->password);
$idis = $row->id;
if($password_real == $password)
{
$infomesg .= "Password Matched<br>";
}
else
{
$errormsg .= "Wrong Email or Password<br>";
}
}
else
{
$errormsg .= "Wrong Email or Password<br>";
}
}
/*
* Submit the form
*/
if($errormsg == ""){
$infomesg .= "Logined";
$_SESSION['idis'] = $idis;
header("location:home/");
exit();
}
}
?>
<!DOCTYPE html>
<html>
<head>
<title>HuzzTech OOP Software</title>
<?php
include 'includes/header.inc.php';
?>
</head>
<body>
<?php
include 'includes/top.inc.php';
?>
<!-------------------PAGE Content---------------------->
<div class="container" style="margin-top:50px;">
<div class="row justify-content-center">
<div class="col-md-8">
<div class="card">
<div class="card-header">Login</div>
<?php if(isset($_SESSION['messeage_d'])){ ?>
<div class="alert alert-success" style="text-align: center;">
<?php
echo $_SESSION['messeage_d'];
unset($_SESSION['messeage_d']);
?>
</div>
<?php } ?>
<?php if($infomesg != ""){ ?>
<div class="alert alert-success" style="text-align: center;">
<?php echo $infomesg; ?>
</div>
<?php } ?>
<?php if($errormsg != ""){ ?>
<div class="alert alert-danger" style="text-align: center;">
<?php echo $errormsg; ?>
</div>
<?php } ?>
<div class="card-body">
<form method="POST" action="">
<input type="hidden" name="_token" value="1f4OpwIwES2fjOmBHlq9vwrO9CL4oIAnfSsut4o3">
<div class="form-group row">
<label for="email" class="col-md-4 col-form-label text-md-right">E-Mail Address</label>
<div class="col-md-6">
<input id="email" type="email" class="form-control " name="email" value="" required="" autocomplete="email" autofocus="">
</div>
</div>
<div class="form-group row">
<label for="password" class="col-md-4 col-form-label text-md-right">Password</label>
<div class="col-md-6">
<input id="password" type="password" class="form-control " name="password" required="" autocomplete="current-password">
</div>
</div>
<div class="form-group row">
<div class="col-md-6 offset-md-4">
<div class="form-check">
<input class="form-check-input" type="checkbox" name="remember" id="remember">
<label class="form-check-label" for="remember">
Remember Me
</label>
</div>
</div>
</div>
<div class="form-group row mb-0">
<div class="col-md-8 offset-md-4">
<button type="submit" name="loginnow" class="btn btn-primary">
Login
</button>
<a class="btn btn-link" href="./forgotpassword">
Forgot Your Password?
</a>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
<!----------------------------------------->
<?php
include 'includes/footer.inc.php';
?>
</body>
</html>