summaryrefslogtreecommitdiff
path: root/src/application/views/form_newtopic.php
blob: d5cbfbdedca183a83a1d0d3dbb492858c56c9b26 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?php

use mystic\forum\Messaging;
use mystic\forum\utils\RequestUtils;

if (($_formError = RequestUtils::getAndClearFormError()) !== null) {
    Messaging::error($_formError);
}

$lastFormUri = "";
$lastForm = RequestUtils::getLastForm($lastFormUri) ?? [];
if ($lastFormUri !== $_SERVER["REQUEST_URI"]) $lastForm = [];
RequestUtils::clearLastForm();

?>
<form action="<?= htmlentities($_SERVER["REQUEST_URI"]) ?>" method="post">
<strong>Topic title:</strong><br>
<input type="text" name="title" value="<?= htmlentities($lastForm["title"] ?? "") ?>" required><br>

<strong>Message:</strong><br>
<textarea name="message" rows="12" cols="60" required></textarea><br>

<button type="submit">Create topic</button>
</form>