minor progress on the post script for new threads and thread replies

This commit is contained in:
hayden 2019-07-07 18:00:56 -05:00
parent 7bbac7a0c4
commit e5318a9f1d
2 changed files with 18 additions and 1 deletions

View File

@ -34,7 +34,7 @@ function display_board(array $settings) {
<p><?php echo $settings['splash'][array_rand($settings['splash'])]; ?></p>
<?php if (isset($_SESSION['username'])): ?>
<hr>
<form action="login.php" method="post" class="input-form">
<form action="post.php" method="post" class="input-form">
<table>
<tr>
<td><b>title:</b></td>
@ -55,6 +55,7 @@ function display_board(array $settings) {
</td>
</tr>
<input type="hidden" name="board_code" value="<?php echo $settings['code']; ?>">
<input type="hidden" name="type" value="new_thread">
</table>
<br>
<button type="submit">post</button>

View File

@ -1,8 +1,24 @@
<?php
//function for image validation
function validate_iamge() {
}
// handle non-post requests
if ($_SERVER['REQUEST_METHOD'] !== 'POST') {
echo 'this isn\'t for you!';
header('refresh:1; url=/');
}
if ($_POST['type'] == 'new_thread') {
// get the variables from the post request
$title = $_POST['title'] or die('invalid request!');
$message = $_POST['message'] or die('invalid request!');
$upload = $_POST['upload'] or die('invalid request!');
} elseif ($_POST['type'] == 'thread_reply') {
} else {
}