Exemplo n.º 1
0
function entry_onsubmit($param, $post)
{
    $data = ["msglist" => gettable("select * from site_guestbook")];
    $scr = new Scriptor("site_guestbook/guestbook.html", $data);
    if (($post = $scr->validate("entry", $post)) === false) {
        return $scr->result();
    }
    dbinsert("site_guestbook", ["name" => $post["name"], "content" => $post["content"]]);
    return child_render($param);
}
Exemplo n.º 2
0
function subscribe_onsubmit($param, $post)
{
    global $_SERVER;
    $scr = new Scriptor("site_guestbook/purchase.html");
    if (($post = $scr->validate("emailsubscribe", $post)) === false) {
        return $scr->result();
    }
    dbinsert("beta_emails", ["email" => $post["email"], "landing" => $_SERVER["SERVER_NAME"]]);
    return redirect("/thanks");
}