-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadmin.php
executable file
·142 lines (122 loc) · 5 KB
/
admin.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
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
139
140
141
142
<!DOCTYPE html>
<html lang="en">
<style>
.form-signin {
max-width: 330px;
padding: 15px;
margin: 0 auto;
color: #017572;
}
.form-signin .form-signin-heading,
.form-signin .checkbox {
margin-bottom: 10px;
}
.form-signin .checkbox {
font-weight: normal;
}
.form-signin .form-control {
position: relative;
height: auto;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
padding: 10px;
font-size: 16px;
}
.form-signin .form-control:focus {
z-index: 2;
}
.form-signin input[type="email"] {
margin-bottom: -1px;
border-bottom-right-radius: 0;
border-bottom-left-radius: 0;
border-color:#017572;
}
.form-signin input[type="password"] {
margin-bottom: 10px;
border-top-left-radius: 0;
border-top-right-radius: 0;
border-color:#017572;
}
h2{
text-align: center;
color: #017572;
}
</style>
</head>
<head>
<title>K17 Food Stall</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
</head>
<link rel="icon" href="/k17/img/k.jpg" sizes="16x16" type="image/png">
<body>
<div class="container-fluid">
<nav class="navbar navbar-inverse">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="/k17/index.html">K17!! Food Stall</a>
</div>
<ul class="nav navbar-nav">
<li><a href="/k17/index.html">Home</a></li>
<li><a href="/k17/nonveg.html">Non-Veg Combo</a></li>
<li><a href="/k17/veg.html">Veg Combo</a></li>
<li><a href="/k17/fastfood.html">Fast Food</a></li>
<li><a href="/k17/food.html">Food For Thought</a></li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li class="active"><a href="/k17/admin.php"><span class="glyphicon glyphicon-send"></span> Admin</a></li>
<li><a href="/k17/register.php"><span class="glyphicon glyphicon-user"></span> Sign Up</a></li>
<li><a href="/k17/index.php"><span class="glyphicon glyphicon-log-in"></span> Login</a></li>
</ul>
</div>
</nav>
</div>
<img src="/k17/img/ceg.png" alt="CEG Logo" height="100" width="100" align="left"><img src="/k17/img/k17.png" alt="CTF Logo" height="100" width="250" align="right">
<h1><p align="center" >Welcome to K17!! Food Stall</p></h1>
<br>
<br><hr>
<br><br>
<h2>Enter Username and Password</h2>
<div class = "container form-signin">
<?php
ob_start();
session_start();
?>
<?php
$msg = '';
if (isset($_POST['login']) && !empty($_POST['username'])
&& !empty($_POST['password'])) {
if ($_POST['username'] == 'admin' &&
$_POST['password'] == 'cegtechforum') {
$_SESSION['valid'] = true;
$_SESSION['timeout'] = time();
$_SESSION['username'] = 'admin';
echo '<p align="center"> You have entered Correct Username and Password</p><br><br>';
echo ' <p><h1 align="center"><a href="/k17/adminfun.html"><button type="button" class="btn btn-success">Proceed</button></a></h1></p>';
}else {
$msg = 'Wrong username or password';
}
}
?>
</div> <!-- /container -->
<div class = "container">
<form class = "form-signin" role = "form"
action = "<?php echo htmlspecialchars($_SERVER['PHP_SELF']);
?>" method = "post">
<h4 class = "form-signin-heading"><?php echo $msg; ?></h4>
<input type = "text" class = "form-control"
name = "username" placeholder = "username = admin"
required autofocus></br><br>
<input type = "password" class = "form-control"
name = "password" placeholder = "password = cegtechforum" required><br><br>
<button class = "btn btn-lg btn-primary btn-block" type = "submit"
name = "login" align="center">Login</button>
</form><br>
<p align="center">Click here to clean <a href = "logout.php" tite = "Logout">Session.</a></p>
</div>
</body>
</html>