function OnRequest() { $requestMethod = $_SERVER['REQUEST_METHOD']; if ($requestMethod == "GET") { threadCloseGet(); } else { //close Thread ModelFacade::closeThread($_GET["id"], $_POST["CloseReason"], ModelFacade::getLoggedInUser()->id); threadClosePost(); header("location:Thread.php?id=" . $_GET["id"]); } }