-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpanel.php
More file actions
138 lines (60 loc) · 3.13 KB
/
panel.php
File metadata and controls
138 lines (60 loc) · 3.13 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
<!DOCTYPE html>
<html>
<head>
<title>Admin Panel || HTS</title>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap & other CSS files -->
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="css/animate.css">
<link rel="stylesheet" type="text/css" href="css/aos.css">
<link rel="stylesheet" type="text/css" href="css/jquery.css">
<link rel="stylesheet" type="text/css" href="css/custom.css">
</head>
<body>
<form action="panel.php" method="GET" class="hiddenvalue">
<input type="text" name="knowst">
<input type="submit" name="submit">
</form>
<center> <div class="panel">
<form action="panel.php" method="post" class="form-control">
<input type="password" class="form-control" name="Adminpass" placeholder="AdminPanel Password">
<input type="submit" name="submit" class="btn btn-success" value="Enter">
</form>
</div>
</center>
</body>
<!-- Required Javascript Files -->
<script type="text/javascript" src="js/aos.js"></script>
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<script type="text/javascript" src="js/script.js"></script>
</html>
<?php
session_start();
if(@$_GET['knowst'] == 'panel') {
echo "<center><p class='alert alert-success'>User logout Successful. Now You can login as Panel Adminstrator</p></center>";
#<center><p class='alert alert-success' id='notice'>User logout Successful. Now You can login as Panel Adminstrator</center>;
}
if( isset( $_SESSION['email'] ) && isset($_SESSION['id']) ) {
header("Location: App_main.php?AlreadyLogged=admin&submit=Submit+Query");
}
if ($_SERVER["REQUEST_METHOD"]=="POST") {
require_once("config.php");
$Adminpass = $_POST['Adminpass'];
$admin_query = mysqli_query($connect, "SELECT id FROM users WHERE email='admin@hts.com' AND password='$Adminpass' AND isadmin='1' LIMIT 1");
while ($row = mysqli_fetch_array($admin_query)) {
$Id = $row['id'];
}
if(mysqli_num_rows($admin_query) == 1) {
$_SESSION['admin'] = 1;
$_SESSION['id'] = $Id;
$_SESSION['email'] = 'admin@hts.com';
header("Location: App_main.php");
}
else {
echo "failed";
}
}
?>