Exemple #1
0
function addCategory()
{
    $controllerCategory = new ControllerCategory();
    $category = new Category();
    $category->category = htmlspecialchars(trim(strip_tags($_POST['category'])));
    $category->category_icon = '';
    $category->created_at = time();
    $category->updated_at = time();
    $controllerCategory->insertCategory($category);
    echo "<script type='text/javascript'>location.href='categories.php';</script>";
}