echo Post::USERNAME(); ?> "> </div> <div> Email:<input type="text" name="email" value="<?php echo Post::EMAIL(); ?> "> </div> <div> Mensagem:<br> <textarea name="mensagem"><?php echo Post::MENSAGEM(); ?> </textarea> </div> <div> <input type="submit"> </div> </form> </body> </html> <?php if ($_SERVER["REQUEST_METHOD"] === "POST") { try { Mep\Container::getFormContato(['username', 'email', 'mensagem'])->prepara()->processa(); } catch (Exception $ex) { die($ex->getMessage()); } }
<?php require_once "Mep/init.php"; use Mep\Handlers\FiltroPost as Post; if ($_SERVER["REQUEST_METHOD"] === "POST") { if (Mep\Container::getToken()->checa(Post::TOKEN())) { try { Mep\Container::getFormRegistro(['matricula', 'nome'], 'Aluno')->prepara()->processa(); } catch (Exception $ex) { die($ex->getMessage()); } } else { Mep\Container::getToken()->flush(); header('Location:demo_banco.php'); die; } } ?> <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Update, Insert and Delete</title> </head> <body> <form action="" method="post"> <div> Matricula:<input type="text" name="matricula" value="<?php echo Post::MATRICULA(); ?> ">