-
Notifications
You must be signed in to change notification settings - Fork 0
/
13.php
133 lines (125 loc) · 4.81 KB
/
13.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
<?php
require '../com/config/DBHelper.php';
session_start();
$level = basename($_SERVER['SCRIPT_FILENAME'], ".php");
if (!isset($_SESSION['username'])) {
header("location:../index.php");
}
if (isset($_SESSION['username']) && $_SESSION['current_level'] != $level) {
header("location:" . $_SESSION['current_level'] . ".php");
}
if (isset($_SESSION['username']) && $_SESSION['on_block'] == $level) {
$now = date('Y-m-d H:i:s');
$time_to_unblock = date($_SESSION['when_to_unblock']);
if ($time_to_unblock <= $now) {
$db = new DBHelper();
$con = $db->getConnection();
$username = $_SESSION['username'];
$query = "UPDATE track_records SET on_block=0 WHERE username='$username'";
$con->query($query);
$_SESSION['on_block'] = 0;
} else {
header("location:blocked.php");
}
}
function test_input($data)
{
$data = trim($data);
$data = stripslashes($data);
$data = htmlspecialchars($data);
return $data;
}
?>
<!doctype html>
<html lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="manifest" href="../site.webmanifest">
<!-- Place favicon.ico in the root directory -->
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<link rel="stylesheet" href="https://code.getmdl.io/1.3.0/material.teal-amber.min.css"/>
<script defer src="https://code.getmdl.io/1.3.0/material.min.js"></script>
<!--<link rel="stylesheet" href="../css/materialize.css" >-->
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link type="text/css" rel="stylesheet" href="../css/materialize.min.css" media="screen,projection"/>
<link rel="stylesheet" href="../css/main.css">
<style>
.toast {
width: 50%;
border-radius: 0;
}
#toast-container {
min-width: 100%;
bottom: 70%;
top: 0%;
right: 0%;
left: 25%;
}
</style>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script type="text/javascript" src="../js/materialize.min.js"></script>
<script>
$(document).ready(function () {
$(".button-collapse").sideNav();
});
</script>
</head>
<body>
<!--[if lte IE 9]>
<p class="browserupgrade">You are using an <strong>outdated</strong> browser. Please <a href="https://browsehappy.com/">upgrade
your browser</a> to improve your experience and security.</p>
<![endif]-->
<!-- Add your site or application content here -->
<!-- Always shows a header, even in smaller screens. -->
<nav>
<div class="nav-wrapper">
<a href="#!" class="brand-logo">Hack_It</a>
<a href="#" data-activates="mobile-demo" class="button-collapse"><i class="material-icons">menu</i></a>
<ul class="right hide-on-med-and-down">
<li><a href="../lboard.php">Leaderboard</a></li>
<li><a href="https://www.reddit.com/r/hack_it/" target="_blank">r/hack_it</a></li>
<li><a href="../about.html">About</a></li>
<li><a href="../logout.php">Log Out</a></li>
</ul>
<ul class="side-nav" id="mobile-demo">
<li><a href="../lboard.php">Leaderboard</a></li>
<li><a href="https://www.reddit.com/r/hack_it/" target="_blank">r/hack_it</a></li>
<li><a href="../about.html">About</a></li>
<li><a href="../logout.php">Log Out</a></li>
</ul>
</div>
</nav>
<div class="row" id="ques">
<form class="col s6" action="answer_verification.php" method="post">
<div class="row">
<!--Put Question Content Here!-->
<h6>Give the name of the manufacturer of the router in the image </h6>
<div style="padding-bottom: 10px;">
<img style="border-radius: 5%" src="qres/mac.jpeg" height="200" width="356">
</div>
<div class="input-field col s12">
<input name="answer" id="input1" class="input-field inline" type="text">
<br/>
<label for="input1">Answer</label>
</div>
</div>
<button class="btn waves-effect waves-light" type="submit" name="action">Submit
<i class="material-icons right">send</i>
</button>
<br>
<br>
<button class="btn waves-effect waves-light" id="hntbtn">Hint ?</button>
<div class="col s12">
<span class="error"><?php if (isset($_GET['a']) && ($_GET['a']) == 'f') {
echo "Answer is incorrect. Try again!";
} ?></span></div>
</form>
</div>
</body>
</html>