-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathclearall.php
148 lines (144 loc) · 4.17 KB
/
clearall.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
143
144
145
146
147
148
<head>
<link rel="stylesheet" type="text/css" href="assets/bootstrap-3.1.1-dist/css/bootstrap.css" />
</head>
<style type="text/css">
.large {
color: #1F1F1F;
font-family:arial;
font-size: 4pt;
width:50%;
}
.chanbody { background:#CCFF66;}
body { background:#DBFF94;}
.tabbody { background:#CCFFCC;}
.link {
color: #1F1F1F;
font-family:arial;
font-size: 4pt;
width:30%;
}
.mainmenu {
width: 8%;
height: 7%;
border-style:inset;
border-width:5px;
}
.content {
border-style:none;
border-width:0px;
}
</style>
<?php
/************************************************************************/
/* PHP Simple PasswordProtect v1.0 */
/* =========================== */
/* */
/* Written by Steve Dawson - http://www.stevedawson.com */
/* Freelance Web Developer - PHP, MySQL, HTML programming */
/* */
/* This program is free software. You can redistribute it and/or modify */
/* but please leave this header intact, thanks */
/************************************************************************/
##########################################################################
require("pass.php");
$password = $passwerd;
##########################################################################
print "<h2 align=\"center\">Restricted Area!</h2>";
// If password is valid let the user get access
if (isset($_POST["password"]) && ($_POST["password"]=="$password")) {
// Specify the target directory and add forward slash
$dir = "commentposts/";
// Open the directory
$dirHandle = opendir($dir);
// Loop over all of the files in the folder
while ($file = readdir($dirHandle)) {
// If $file is NOT a directory remove it
if(!is_dir($file)) {
unlink ("$dir"."$file"); // unlink() deletes the files
}
}
// Close the directory
closedir($dirHandle);
$file_handle = fopen("replypostlist.php", "w+");
$file_contents = "<?
//DONT TOUCH ANYTHING BELOW THIS LINE!!!!!!!!!!!!!!!!
// THAT INCLUDES THE HTML!!!!!!
?>
<head>
<title>replypostlist</title>
<link rel=\"stylesheet\" type=\"text/css\" href=\"assets/bootstrap-3.1.1-dist/css/bootstrap.css\" />
</head></pre></pre></div></div></pre>
<style type=\"text/css\">
.large {
color: #1F1F1F;
font-family:arial;
font-size: 4pt;
width:50%;
}
.chanbody { background:#CCFF66;}
body { background:#DBFF94;}
.tabbody { background:#CCFFCC;}
.link {
color: #1F1F1F;
font-family:arial;
font-size: 4pt;
width:30%;
}
.mainmenu {
width: 8%;
height: 7%;
border-style:inset;
border-width:5px;
}
.content {
border-style:none;
border-width:0px;
}
</style>
";
fwrite($file_handle, $file_contents);
fclose($file_handle);
echo "<head>
<link rel=\"stylesheet\" type=\"text/css\" href=\"assets/bootstrap-3.1.1-dist/css/bootstrap.css\" />
</head>
<style type=\"text/css\">
.large {
color: #1F1F1F;
font-family:arial;
font-size: 4pt;
width:50%;
}
.chanbody { background:#CCFF66;}
body { background:#DBFF94;}
.tabbody { background:#CCFFCC;}
.link {
color: #1F1F1F;
font-family:arial;
font-size: 4pt;
width:30%;
}
.mainmenu {
width: 8%;
height: 7%;
border-style:inset;
border-width:5px;
}
.content {
border-style:none;
border-width:0px;
}
</style> success! <a href=\"config.php\">go back to control panel</a>";
}
else
{
// Wrong password or no password entered display this message
if (isset($_POST['password']) || $password == "") {
print "<p align=\"center\"><font color=\"red\"><b>Incorrect Password</b><br>Please enter the correct password</font></p>";}
print "<form method=\"post\"><p align=\"center\">Please enter your password for access<br>";
print "<input name=\"password\" type=\"password\" size=\"25\" ><input value=\"Login\" type=\"submit\"></p></form>";
}
print "<br><br><p align=\"center\"></a></p>";
?>
<BR>
</body>
</html>