get_current_user(); if ($user->level == USER_LEVEL_MODERATOR) { if (strcasecmp($delete, "on") == 0) { $thread = new Thread(); $thread->get_from_database($thread_id); delete_thread($thread); header("Location: /"); exit(); } } header("Location: viewthread.php?id=$thread_id"); exit(); } header("Location: /");