-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.php
67 lines (64 loc) · 2.54 KB
/
index.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
<?php
$connection = mysqli_connect("localhost", "root", "");
$db = mysqli_select_db($connection,"eventon");
if(isset($_POST['login'])){
$query = "select * from users where email = '$_POST[email]' AND password = '$_POST[password]'";
$query_run = mysqli_query($connection,$query);
if(mysqli_num_rows($query_run)){
while($row = mysqli_fetch_assoc($query_run)){
echo "<script>
window.location.href = 'user_dashboard.php';
</script>";
}
}
else{
echo "<script>alert('Please Enter correct email id and password');
window.location.href = 'index.php';
</script>";
}
}
?>
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title>EventON</title>
<!-- Bootstrap files -->
<link rel="stylesheet" type="text/css" href="bootstrap-4.4.1/css/bootstrap.min.css">
<script src="bootstrap-4.4.1/js/bootstrap.min.js" charset="utf-8"></script>
<!-- CSS File -->
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<!-- Header section code start here -->
<div class="row" id="header">
<div class="col-md-4">
</div>
<div class="col-md-4">
<h3>EventON</h3>
</div>
<div class="col-md-4">
</div>
</div>
<!-- Login form code starts here -->
<section id="login_form">
<div class="row">
<div class="col-md-4 m-auto block">
<center><h4>Login form</h4></center>
<form action="index.php" method="post">
<div class="form-group">
<label>Email ID:</label>
<input class="form-control" type="text" name="email" placeholder="Enter your email">
</div>
<div class="form-group">
<label>Password:</label>
<input class="form-control" type="password" name="password" placeholder="Enter your Password">
</div>
<button class="btn btn-primary" type="submit" name="login">Login</button>
</form>
<a href="register.php">Click here to register</a>
</div>
</div>
</section>
</body>
</html>