<?php use mystic\forum\orm\Topic; $formId = "addpost"; $topicId = $_GET["topic"] ?? throw new Exception("Missing topic id"); $topic = new Topic(); $topic->id = $topicId; if (!$db->fetch($topic)) { http_response_code(404); msg_error("No topic exists with this id"); exit; }