Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
Olá pessoal,
Estou com um formulário de contato onde NÃO HAVIA o campo "telefone" que eu acrescentei...
O formulário está funcionando direitinho, mas o email que chega NÃO CHEGA COM O N. DE TELEFONE PREENCHIDO e não acho o erro...
A mensagem chega assim:
fulano de tal
email@dominio.com.br$telefone[2]
Message:
hcdjcjg
$name = array('Name','name',NULL,NULL);
$email = array('Email','email',NULL,NULL,NULL);
$telefone = array('Telefone','telefone',NULL,NULL);
$subject = array('Assunto','subject',NULL,NULL);
$message = array('Mensagem','message',NULL,NULL);
$security = array('Pergunta de segurança','security',NULL,NULL,NULL);
$error_message = '';
if (!isset($_POST['submit'])) {
showForm();
} else { //form submitted
$error = 0;
if(!empty($_POST['check'])) die("Dados inválidos");
if(!empty($_POST['name'])) {
$name[2] = clean_var($_POST['name']);
if (function_exists('htmlspecialchars')) $name[2] = htmlspecialchars($name[2], ENT_QUOTES);
}
else {
$error = 1;
$name[3] = 'color:#FF0000;';
}
if(!empty($_POST['email'])) {
$email[2] = clean_var($_POST['email']);
if (!validEmail($email[2])) {
$error = 1;
$email[3] = 'color:#FF0000;';
$email[4] = '<strong><span style="color:#FF0000;">Email inválido</span></strong>';
}
}
else {
$error = 1;
$email[3] = 'color:#FF0000;';
}
if(!empty($_POST['telefone'])) {
$telefone[2] = clean_var($_POST['telefone']);
if (function_exists('htmlspecialchars')) $telefone[2] = htmlspecialchars($telefone[2], ENT_QUOTES);
}
else {
$error = 1;
$telefone[3] = 'color:#FF0000;';
}
if(!empty($_POST['subject'])) {
$subject[2] = clean_var($_POST['subject']);
if (function_exists('htmlspecialchars')) $subject[2] = htmlspecialchars($subject[2], ENT_QUOTES);
}
else {
$error = 1;
$subject[3] = 'color:#FF0000;';
}
if(!empty($_POST['message'])) {
$message[2] = clean_var($_POST['message']);
if (function_exists('htmlspecialchars')) $message[2] = htmlspecialchars($message[2], ENT_QUOTES);
}
else {
$error = 1;
$message[3] = 'color:#FF0000;';
}
if(empty($_POST['security'])) {
$error = 1;
$security[3] = 'color:#FF0000;';
} else {
if($question_answers[$_POST['question']] != strtolower(clean_var($_POST['security']))) {
$error = 1;
$security[3] = 'color:#FF0000;';
$security[4] = '<strong><span style="color:#FF0000;">Wrong answer</span></strong>';
}
}
if ($error == 1) {
$error_message = '<span style="font-weight:bold;font-size:90%;">Por favor, preencha corretamente os campos em vermelho !.</span>';
showForm();
} else {
if (function_exists('htmlspecialchars_decode')) $name[2] = htmlspecialchars_decode($name[2], ENT_QUOTES);
if (function_exists('htmlspecialchars_decode')) $telefone[2] = htmlspecialchars_decode($telefone[2], ENT_QUOTES);
if (function_exists('htmlspecialchars_decode')) $subject[2] = htmlspecialchars_decode($subject[2], ENT_QUOTES);
if (function_exists('htmlspecialchars_decode')) $message[2] = htmlspecialchars_decode($message[2], ENT_QUOTES);
$message = "$name[2]\r\n$email[2]\r\$telefone[2]\r\n\r\nMessage:\r\n$message[2]\r\n";Carregando comentários...