-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path20.php
46 lines (45 loc) · 1.45 KB
/
20.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
<?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 xmlns:left="http://www.w3.org/1999/xhtml">
<head>
<meta charset="UTF-8">
<title>You've ripped a hole in the fabric of the internet.</title>
</head>
<body>
<h1 align="center">Error 404. Page Not Found</h1>
<img src="qres/404" alt="Page Not Found (404)."
style="position: absolute; left: 50%; top: 50%; margin-left: -285px; margin-top: -190px;">
<h7 style="position: absolute; left: 50%; top: 130%; margin-top: -290px;">Or Is It?</h7>
</body>
</html>