POR FAVOR, ME AJUDEM COM ESSE ERRO FATAL ERROR: CALL TO A MEMBER FUNCTION PREPARE() ON NULL IN C:\XAMPP\HTDOCS\INDEX.PHP ON LINE 27
15/01/2016
0
<?php require_once('conexao.php'); ?> <!doctype html> <html lang="pt-br"> <head> <meta charset="utf-8"> <title>Cadastro</title> </head> <body> <?php require_once('Cliente.class.php'); $nome = trim(filter_input(INPUT_POST, 'nome')); $email = trim(filter_input(INPUT_POST, 'email')); $cpf = trim(filter_input(INPUT_POST, 'cpf')); $nasc = trim(filter_input(INPUT_POST, 'nasc')); $pass = trim(filter_input(INPUT_POST, 'pass')); $cliente = new Cliente(); $cliente->setNome($nome); $cliente->setEmail($email); $cliente->setCpf($cpf); $cliente->setNasc($nasc); $cliente->setPass($pass); $conexao = BD::conn(); $inserir = $conexao->prepare('INSERT INTO cliente (nome, email, cpf, dataNasc, pass) VALUES(:nome, :email, :cpf, :nasc, :pass)'); $inserir->bindValue(':nome', $nome); $inserir->bindValue(':email', $email); $inserir->bindValue(':cpf', $cpf); $inserir->bindValue(':nasc', $nasc); $inserir->bindValue(':pass', $pass); $inserir->execute(); ?> <form action="" method="post"> <br> Nome:<br><input type="text" name="nome"><br><br> E-mail:<br><input type="text" name="email"><br><br> CPF:<br><input type="text" name="cpf"><br><br> Nascimento:<br><input type="date" name="nasc"><br><br> Senha:<br><input type="password" name="pass"><br><br> <input type="submit" value="Cadastrar"> </form> </body> </body> </html>
Wesley Jonas
Curtir tópico
+ 0
Responder
Clique aqui para fazer login e interagir na Comunidade :)