0
I am putting a form in my index.php, to be sent the completed data to my email.
How do I stop when the person clicks the Submit(submit) button, the page nay upgrade?
The system is working fine, send it to my e-mail correctly, but when I click on the send button, it looks like.
Does anyone know why you’re making this mistake?
index php.
<?php
$msg=0;
@$msg= $_REQUEST['msg'];
?>
<!DOCTYPE html>
<html lang="pt-br">
<head> etc...
<body>
<form action="processaForm.php" method="post">
<label for="nome">Nome:</label><br>
<input id="nome" name="nome" type="text" required><br>
<label for="email">E-mail: (obrigatório)</label><br>
<input id="email" type="email" name="email" required><br>
<label for="telefone"> Telefone/Whatsapp:</label><br>
<input type="text" name="telefone" id="telefone" value="27 " required><br>
<label for="assunto"> Descreva o serviço que deseja:</label><br>
<textarea name="assunto" id="mensagens assunto"> </textarea><br>
<input type="submit" id="miniSuccessAnimation" class="btn btn-success">
</form>
</body>
PHP
<?php
$para= "[email protected]";
$assunto= "Contato pelo Site";
$nome= $_REQUEST['nome'];
$fone= $_REQUEST['telefone'];
$email= $_REQUEST['email'];
$msg= $_REQUEST['assunto'];
$corpo = "<strong> Mensagem de Contato</strong><br><br>";
$corpo .= "<strong> Nome: </strong> $nome";
$corpo .= "<br><strong> Telefone: </strong> $fone";
$corpo .= "<br><strong> Email: </strong> $email";
$corpo .= "<br><strong> Mensagem: </strong> $msg";
$header = "Content-Type: text/html; charset= utf-8\n";
$header .="From: $email Reply-to: $email\n";
mail($para,$assunto,$corpo,$header);
header("location:index.php?msg=enviado");
?>
Post your code, help us help you.
– Guilherme Biancardi
Okay, I’ve entered the code.
– Lukas Monteiro
That mistake is because the path of
<form>
or ofhader("location:")
you’re probably wrong– Costamilam