-
Notifications
You must be signed in to change notification settings - Fork 0
/
login.php
70 lines (49 loc) · 1.88 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
<?php
if(isset($_POST['login'])){
include "./includes/db.php";
$username = $_POST['username'];
$password = $_POST['password'];
$query = "SELECT * FROM customer WHERE username = '$username' AND user_password = '$password';";
$result = mysqli_query($conn,$query);
if(!$result){
die("Query Failed" . mysqli_error($conn));
}
$count=mysqli_num_rows($result);
if($count > 0){
echo '<script>alert("Login successfully")</script>';
echo "<script>window.location.href = 'index.php';</script>";
}
else
{
echo "<h4 style='color: red; text-align: center; margin-top: 20px;'>credentials do not match!</h4>";
}
}
?>
<?php include "./includes/header.php"; ?>
<div class="d-flex justify-content-center align-items-center my-5 " >
<div class="border mx-5 p-3 col-lg-4 rounded" >
<form action="" method="post" enctype="multipart/form-data">
<h4 class="text-center font-weight-bold" >Login</h4>
<div class="form-group col-md-12">
<label for="username">Enter Username</label>
<input value="" type="text" class="form-control" name="username">
</div>
<div class="form-group col-md-12">
<label for="password">Enter Password</label>
<input type="password" class="form-control" name="password" >
</div>
<div class="form-group col-md-12 d-flex justify-content-center my-3">
<!-- <input type="submit" value="Login" class="form-control" name="password" > -->
<button name="login" class="btn btn-primary btn-lg " style="width:200px">
<i class="fa-solid fa fa-right-to-bracket"></i>Login</button>
</div>
<div>
<div class="row d-flex justify-content-space-between" >
<p class="col-md-6" style="color:orange" ><a href="index.php" class="text-decoration-none">
<i class="fa-solid fa fa-home"></i>Home</a></p>
<p class="col-md-6" >Don't have an account?<a class="text-decoration-none" href="sign_up_inc.php">Register</a></p>
</div>
</div>
</form>
</div>
</div>