-
Notifications
You must be signed in to change notification settings - Fork 38
/
Copy pathindex.php
88 lines (78 loc) · 3.35 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<?php
require_once "dbconnection.php";
require_once "session.php";
if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST['submit'])) {
$email = $_POST['email'];
$password = $_POST['password'];
$qry = "SELECT * FROM `login` WHERE `email`='$email' AND `password`='$password'";
$run = mysqli_query($dbcon, $qry);
$row = mysqli_num_rows($run);
if ($row < 1) {
?>
<script>
alert("Opps! plz Enter Your Username and Pswd again..");
window.open('index.php', '_self');
</script> <?php
} else {
$data = mysqli_fetch_assoc($run);
$id = $data['u_id']; //fetch id value of user
$email = $data['email'];
$_SESSION['uid'] = $id; //now we can use it until session destroy
$_SESSION['emm'] = $email;
?>
<script>
alert("स्वागत हैं आपका 🙏");
window.open('home/home.php', '_self');
// changes made here
</script> <?php
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Login</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css">
<style>
body {
background-image: url('images/10.jpg');
background-repeat: no-repeat;
background-size: cover;
}
</style>
</head>
<body>
<h1 align='center' style="margin: 15px; color:seagreen;font-weight: bold;font-family:'Times New Roman', Times, serif">TYPHOON COURIER SERVICE</h1>
<hr />
<P align='center' style="font-weight: bold;color:orange;font-family:'Times New Roman', Times, serif">The Fastest Courier Service Ever</P>
<div>
<h5><a href="admin/adminlogin.php" style="float: right; margin-right:40px; color:blue; margin-top:0px">AdminLogin</a></h5>
</div>
<div class="container" style="margin-top: 60px; width:50%;">
<div class="row">
<div class="col-md-12">
<h2 style="color: #273c75;">Login</h2>
<p style="color:#e84118;">Please Fill Your ⮯⮯</p>
<!-- <?php echo $error; ?> -->
<form action="" method="post">
<div class="form-group">
<label>Email Address</label>
<input type="email" name="email" class="form-control" placeholder="Enter username/emailId" required />
</div>
<div class="form-group">
<label>Password</label>
<input type="password" name="password" class="form-control" placeholder="Enter your password" required>
</div>
<div class="form-group">
<input type="submit" name="submit" class="btn btn-primary" value="SignIn" />
<button onclick="window.location.href='resetpswd.php'" class="btn btn-danger" style="cursor:pointer">Reset Password</button>
</div>
<p style="color: #e84118;">Don't have an account?⮞➤ <a href="register.php">Register here</a>.</p>
</form>
</div>
</div>
</div>
</body>
</html>