'', 'game' => '', 'tag' => '', 'body' => '', 'author' => '', ]; if ($_SERVER['REQUEST_METHOD'] === 'POST') { foreach ($values as $key => $value) { $values[$key] = trim($_POST[$key] ?? ''); } if ($values['title'] === '') { $errors[] = 'Title is required.'; } if ($values['game'] === '') { $errors[] = 'Game is required.'; } if ($values['body'] === '' || strlen($values['body']) < 10) { $errors[] = 'Opening post must be at least 10 characters.'; } if ($values['author'] === '') { $errors[] = 'Author name is required.'; } if (!$errors) { $stmt = db()->prepare( "INSERT INTO forum_threads (title, game, tag, body, author) VALUES (:title, :game, :tag, :body, :author)" ); $stmt->execute([ ':title' => $values['title'], ':game' => $values['game'], ':tag' => $values['tag'] ?: null, ':body' => $values['body'], ':author' => $values['author'], ]); $id = (int)db()->lastInsertId(); header('Location: thread.php?id=' . $id . '&created=1'); exit; } } include __DIR__ . '/includes/header.php'; ?>

Start a Thread

Lead the conversation on builds, patches, or loot.

Back to forums