-
Notifications
You must be signed in to change notification settings - Fork 2
/
process.php
146 lines (138 loc) · 4.88 KB
/
process.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
<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");
require("author.php");
$password = $passwerd;
##########################################################################
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<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>
<html>
<head>
<title>Simple Password Protect - PHP PasswordProtect</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
P { FONT-SIZE: 8pt; COLOR: #000000; FONT-FAMILY: Verdana, Tahoma, Arial}
TD { FONT-SIZE: 8pt; COLOR: #000000; FONT-FAMILY: Verdana, Tahoma, Arial}
-->
</style>
</head>
<body>
<?php
print "<h2 align=\"center\">Restricted Area!</h2>";
// If password is valid let the user get access
if (isset($_POST["password"]) && ($_POST["password"]=="$password")) {
$title = htmlentities($_GET['title']);
require("timezone.php"); // You can Change this to your timezone if you want find list of timezones here:http://php.net/manual/en/timezones.php
$date = date('Y_m_d-H.i.s');
$meta = "<P><div id=\"" . $title . $date ."\"><pre class=\"chanbody\">";
$metae = "</div></pre></P>";
$img = $_GET['img'];
$comment = $_GET['comment'];
$file_handle = fopen("blogposts/" . $title . $date . ".php", "c+");
if(strlen($img) > 0)
{
$file_contents = $meta . "Title:<font size=\"3\">" . $title . "</font><P> " . "Date:" . $date . "<br/>Author:" . $author . "<P>postid:" . $title . $date ."<P><a href=\"" . $img . "\"target=\"_blank\"><img src=\"" . $img . "\" width=\"30%\" height=\"30%\"></a><P>" . $comment . $metae . "\n";
}
else
{
$file_contents = $meta . "Title:<font size=\"3\">" . $title . "</font><P> " . "Date:" . $date . "<br/>Author:" . $author . "<P>postid:" . $title . $date ."<P><P>" . "<P> comment:<P>" . $comment . $metae . "\n";
}
fwrite($file_handle, $file_contents);
fclose($file_handle);
$file_handle = fopen("blogpostlist.php", "c+");
$file_contents = "\n
<?php
error_reporting(0);
\$file_handle = fopen(\"blogposts/" . $title . $date . ".php\", \"r+\");
\$content = file_get_contents(\"blogposts/". $title . $date . ".php\");
print \$content;
fclose(\$file_handle);
?>\n</div></pre></p>". file_get_contents("blogpostlist.php");
fwrite($file_handle, $file_contents);
fclose($file_handle);
print "Done! :) <a href=\"index.php\">click here to go back to home</a><P><a href=\"blogpostlist.php\">click here to go back to site home</a><P><a href=\"config.php\">click here to view content list</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>