summaryrefslogtreecommitdiff
path: root/make-post.php
diff options
context:
space:
mode:
Diffstat (limited to 'make-post.php')
-rw-r--r--make-post.php10
1 files changed, 7 insertions, 3 deletions
diff --git a/make-post.php b/make-post.php
index 200f853..2feff1c 100644
--- a/make-post.php
+++ b/make-post.php
@@ -1,8 +1,9 @@
<?php
-header('Content-type: text/html; charset=utf-8');
-$dir = '/home/luke/j1-uploads';
+require('config.php');
+global $dir;
if (!isset($_POST['filename'])) {
+ include('header.php');
echo '<form method="post" action="make-post.php">';
echo '<ul>';
if ($handle = opendir($dir)) {
@@ -19,7 +20,7 @@ if (!isset($_POST['filename'])) {
echo '</ul>';
echo '<input type="submit" value="submit" />';
echo '</form>';
- exit();
+ include('footer.php');
}
$filename = $dir.'/'.rawurlencode($_POST['filename']);
@@ -51,6 +52,7 @@ foreach ($lines as $line) {
}
if (!isset($_POST['q'])) {
+ include('header.php');
echo '<form method="post" action="make-post.php">';
echo '<input type="hidden" name="filename" value="'.htmlentities($_POST['filename']).'" />';
echo '<textarea name="open"></textarea>';
@@ -93,7 +95,9 @@ if (!isset($_POST['q'])) {
}
echo '<input type="submit" value="submit" />';
echo '</form>';
+ include('footer.php');
} else {
+ header('Content-type: text/plain; charset=utf-8');
$quotes = array();
foreach ($_POST['q'] as $reporter => $quote_id) {
$quote = $reporters[$reporter][$quote_id];