-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
64 lines (52 loc) · 1.55 KB
/
Copy pathindex.php
File metadata and controls
64 lines (52 loc) · 1.55 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
<?php session_start(); ?>
<?php include('dbcon.php'); ?>
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div class="form-wrapper">
<form action="#" method="post">
<h3>Login Here</h3>
<div class="form-item">
<input type="text" name="user" required="required" placeholder="Email" autofocus required></input>
</div>
<div class="form-item">
<input type="password" name="pass" required="required" placeholder="Password" required></input>
</div>
<br>
<div class="button-panel">
<input type="submit" class="button" title="Log In" name="login" value="Login"></input>
</div>
</form>
<?php
if (isset($_POST['login']))
{
$username = mysqli_real_escape_string($con, $_POST['user']);
$password = mysqli_real_escape_string($con, $_POST['pass']);
$query = mysqli_query($con, "SELECT * FROM users WHERE email='$username'");
$row = mysqli_fetch_array($query);
if(password_verify($password, $row['password']))
{$num_row = mysqli_num_rows($query);}
if ($num_row > 0 & $row['Reviewer']==0)
{
if( $row['verified']==1)
{
$_SESSION['user_id']=$row['user_id'];
header('location:home.php');}
else {
echo 'Please verify your email address.';}
}
else
{
echo 'Invalid Username and Password Combination';
}
}
?>
<br>
<div class="reminder">
<p>Not a member? <a href="ResponsiveRegistration.php">Sign up now</a></p>
</div>
</div>
</body>
</html>