diff options
Diffstat (limited to 'create_thread.php')
-rw-r--r-- | create_thread.php | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/create_thread.php b/create_thread.php index 6fb7df9..a203b39 100644 --- a/create_thread.php +++ b/create_thread.php @@ -10,6 +10,7 @@ <h2>Create a new thread</h2> <?php include_once 'includes/Session.php'; +include_once 'includes/error.php'; if (!Session::get()->is_signed_in()) { trigger_error('You must be <a href="signin.php">signed in</a> to create a thread.'); exit(); @@ -44,6 +45,7 @@ if (!Session::get()->is_signed_in()) { <?php include_once 'includes/functions_post.php'; include_once 'includes/functions_thread.php'; +include_once 'includes/error.php'; if ($_SERVER['REQUEST_METHOD'] == 'POST') { $post_content = filter_input(INPUT_POST, 'post_content', FILTER_SANITIZE_STRING); @@ -51,7 +53,7 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') { $thread_cat = filter_input(INPUT_POST, 'thread_cat', FILTER_SANITIZE_NUMBER_INT); if (empty($thread_subject) or !$thread_subject) { - echo 'Thread subject cannot be empty'; + trigger_error('Thread subject cannot be empty'); } else { $thread_id = create_thread($thread_subject, $thread_cat); create_post($post_content, $thread_id, $thread_cat); |