-3
'Cause you’re making that mistake?
Parse error: syntax error, unexpected '{' on line 3
Php code
<?php
if (isset($_POST['email'] && !empty($_POST['email'])){
$nome = addslashes($_POST['name']);
$email = addslashes($_POST['email']);
$mensagem = addslashes($_POST['mens']);
$toMe = "[email protected]";
$subject = "Contato - Douglas";
$body = "Nome: ".$nome. "\r\n".
"Email: ".$email."\r\n".
"Mensagem: ".$mens;
$header = "From: [email protected]"."\r\n"
."Reply-To: ".$email."\e\n"
."X=Mailer:PHP/"phpversion();
if(mail($toMe, $subject, $body, $header)){
echo("Email enviado com sucesso!");
}else {
echo("Email não pode ser enviado!");
}
}
?>
Html Code
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Contato</title>
<style type="text/css">
body{font-family: Arial, Helvetica, sans-serif}
.content{display: flex;justify-content: center}
.contato{width: 100%; max-width: 500px;}
.form{display: flex;flex-direction: column}
.field{padding: 10px; margin-bottom: 15px; border: 1px solid #DDD; border-radius: 5px; font-family: Arial, Helvetica, sans-serif; font-size: 16px}
textarea{height: 150px}
</style>
</head>
<body>
<section class= "content">
<div class="contato">
<h3>Formulário de Contato</h3>
<form class="form" method="POST" action="./email.php">
<input class="field" name="name" placeholder="Nome">
<input class="field" name="email" placeholder="E-mail">
<textarea class="field" name="mens" placeholder="Digite sua Mensagem Aqui!!">
</textarea>
<input class="field" type="submit" value="Enviar!">
</form>
</div>
</section>
</body>
</html>
Not missing a parentheses in the if no ?
if (isset($_POST['email']) && !empty($_POST['email'])){
And the "eçe" with cedilha, in the first line of your question, will also give error.– Pedro Augusto
One parenthesis left to close your if isset.
– Vinicius Gabriel
It was bad at the beginning
– VINICIUS DE AGUIAR Benvinda