-
Notifications
You must be signed in to change notification settings - Fork 0
/
admin.php
64 lines (51 loc) · 1.29 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
<?php
//session_start();
$secretErr = "";
$secret = "";
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
if (empty($_POST["secret"])) {
$secretErr = "Secret is required";
}
else {
$secret = test_input($_POST["secret"]);
if (!file_exists("secret.txt")) {
file_put_contents("secret.txt", $secret . "\n");
}
}
//exit();
}
function test_input($data) {
$data = trim($data);
$data = stripslashes($data);
$data = htmlspecialchars($data);
return $data;
}
?>
<!-- Footer -->
<div id="footer" class="wrapper style2">
<div class="container">
<section>
<header class="major">
<h2 id="Contact Me">Admin</h2>
<span class="byline">Enter secret: </span>
</header>
<form method="post" action="admin.php">
<div class="row half">
<div class="12u">
<input class="text" type="text" name="secret" id="secret" placeholder="Secret" /><?php echo $secretErr;?>
</div>
</div>
<div class="row half">
<div class="12u">
<ul class="actions">
<li>
<input type="submit" value="Submit" class="button alt" />
</li>
</ul>
</div>
</div>
</form>
</section>
</div>
</div>
<!-- /Footer -->