Exemplo n.º 1
0
function handle_create()
{
    if (!$_POST['title']) {
        error('<b>Title</b> cannot be empty.');
    } else {
        $read = new Read(array('title' => $_POST['title'], 'author' => $_POST['author'], 'link' => $_POST['link'], 'illustration' => $_POST['illustration']));
        if ($read->create()) {
            notice('Succesfully added <b>' . $_POST['title'] . '</b>.');
        } else {
            error('An error occured while trying to save <b>' . $_POST['title'] . '</b>.');
        }
    }
}