-5
<?php
if(isset($_SERVER['REQUEST_METHOD']) AND $_SERVER['REQUEST_METHOD'] == 'POST'){
extract($_POST);
if($nome == '' OR strlen($nome)<4){
echo 'Insira um nome existente';
}elseif($sobrenome=='' OR strlen($sobrenome)<6){
echo 'Insira um sobrenome existente';
}elseif($email==''){
echo 'Insira seu e-mail';
}elseif(!preg_match("/^[az0-9_\.\-]+@[az0-9_\.\-}*{a-z0-9_\-]+\.[a-z]{2,4}$/i",$email)){
echo 'E-mail invalido tente outro';
}else{
include('../../sllapsocial/classes/DB.class.php');
$verificar = DB::getConn()->prepare("SELECT `id` FROM `usuarios` WHERE `email`=?");
if($verificar->execute(array($email))){
if($verificar->rowCount()>=1){
echo 'Este e-mail ja existe';
}elseif($senha=='' OR strlen($senha)<4){
echo'Senha fraca Insira mais caracteres';
}elseif(strtolower($capctha) <> strtolower($_SESSION['capcthaCadastro'])){
echo 'Codigo errado';
}else{
$senhaInsert = sha1($senha);
$nascimento = "$ano-$mes-$dia";
$inserir = DB::getConn()->prepare("INSERT INTO `usuarios` SET `email`=?, `senha` =?, `nome`=? `sobrenome`=?, `sexo`=?, `nascimento`=?`cadastro`=NOW()");
if($inserir->execute(array($nome,$sobrenome,$email,$senhaInsert,$nascimento,$sexo))){
header('Location: ./');
}
}
}
}
}
?>
Bacco I am new in this error is the following when I enter the form and submit it appears this variable error and appears 'insert an existing name' will q the table of users is not beating? THANK YOU FOR YOUR ATTENTION
– ndroid
Looks like you want to pick up a form field... are doing it correctly:
$_POST['nome_do_campo']
?– Papa Charlie
Place the part of the form where the name field is set.
– rray
He is giving Extract.
– Papa Charlie
Davidjesus @Papacharlie has already kicked off the problem, but it would be nice if you [Edit] the question and add the form that is sending the data as well.
– Bacco