예제 #1
0
function newThreadPost()
{
    $subcategory = $_GET["subcategory"];
    $title = trim($_POST["title"]);
    $content = trim($_POST["content"]);
    if (empty($title) or empty($content)) {
        checkEmptyValues($title, $content);
    } else {
        $postId = ModelFacade::insertThread($title, $content, $subcategory, ModelFacade::getLoggedInUser()->id);
        header("location:Thread.php?id=" . $postId);
    }
}