-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsubmit_thread.php
More file actions
27 lines (22 loc) · 1.33 KB
/
submit_thread.php
File metadata and controls
27 lines (22 loc) · 1.33 KB
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
<?php
echo "<h1>Submit article</h1><hr><br>";
if(isset($_SESSION['loggedin'])){
require_once('php/_conn.php');
require_once('php/_lib.php');
//check if user is banned
$stmt = $pdo->prepare("SELECT lift FROM bans WHERE userid = ?;");
$stmt->bindValue(1, $_SESSION['userid']);
$stmt->execute();
$unban = $stmt->fetchColumn();
if(!((time() < strtotime($unban) + 14400) && isset($unban))){
echo '<form action="php/thread_submitted.php" method="post" name="submitform">
<label for="submit_title">Enter a title:</label><br>
<input type="text" id="submit_title" name="submit_title" style="width:98%;" size="64" class="textfield" value="';if(isset($_SESSION['submit_title'])) echo $_SESSION['submit_title']; echo '"><br>
<label for="submit_text">Message:</label><br>';
include_once('php/_msg_buttons.php');
drawMsgButtons('submit_text');
echo '<textarea id="submit_text" name="submit_text" rows="20" style="width:98%;" class="textfield">';if(isset($_SESSION['submit_text'])) echo $_SESSION['submit_text'];else 'Enter message here.'; echo '</textarea><br>
<input type="submit" name="submit" value="Submit"></form><br>';
} else echo "<p>Banned users cannot submit a thread. Unban@: ".$unban."</p>";
} else echo "<p>You must login to submit an article.</p>";
?>