-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmailbox_admin.php
More file actions
42 lines (32 loc) · 807 Bytes
/
mailbox_admin.php
File metadata and controls
42 lines (32 loc) · 807 Bytes
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
<?php
session_start();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>login action</title>
</head>
<body>
<?php
include_once("connect.php");
$username = $_POST['username'];
$pass = $_POST['password'];
$flag = 0;
$selectQuery = "select * from admin";
$result = mysqli_query($con, $selectQuery);
while ($row = mysqli_fetch_array($result)) {
if ($username == $row['username'] && $pass == $row['password']) {
$flag = 1;
break;
}
}
if ($flag == 0) {
header("location:admin_login.php?msg=Invalid username OR Password");
} else {
session_start();
$_SESSION["username"] = $username;
header("location:admin.php");
}
?>
</body>
</html>