is_signed_in()) { die('You must be signed in to reply to a thread.'); } $reply_content = filter_input(INPUT_POST, 'reply_content', FILTER_SANITIZE_STRING); $thread_id = filter_input(INPUT_POST, 'reply_to', FILTER_SANITIZE_NUMBER_INT); $thread = new Thread(); $thread->get_from_database($thread_id); create_post($reply_content, $thread_id, $thread->category); header("Location: ../thread.php?id=" . $_GET['reply_to']);