0
hello good need help I am trying to make contact form to then receive in the email and wanted to appear a popup instead of page to confirm sending can help me
**mail.php**
<?php
if (isset($_POST['formSubmit1'])) {
// Process the form
$message = "Thank you for registering! We will respond to your request shortly";
$name = $_POST['formName'];
$email = $_POST['formEmail'];
$telemovel = $_POST['formTelem'];
$comments = $_POST['formMessage'];
$date = gmdate("M d Y");
}else{
echo " submeter form primeiro!";
exit;
}
$to = "meu mail";
$subject = "Registration Submission";
$body = " Date: $date \n Registrant Name/Name's: $name \n Registrant E-mail: $email \n \n Contacto: $telemovel \n \n User Comments: \n $comments \n \n";
mail($to,$subject,$body);
}
?> <
!doctype html >
<
html >
<
head >
<
meta charset = "utf-8" >
<
title > Admin panel < /title> < /
head >
<
body >
<
h1 > ::DADOS RECEBIDOS:: < /h1> <
p > & nbsp; < /p> <
h1 > <?php echo $message; ?> < /h1>
<
/body> < /
html >
<form action="mail.php" method="post">
<div class="single-form">
<input class="form-control" type="text" placeholder="Nome" name="formName" id="formName">
</div>
<div class="single-form">
<input class="form-control" type="text" placeholder="Email" name="formEmail" id="formEmail">
</div>
<div class="single-form">
<input class="form-control" type="text" placeholder="Telefone" name="formTelem" id="formTelem">
</div>
<div class="single-text-area">
<textarea class="form-control" name="formMessage" id="formMessage" cols="30" rows="10"></textarea>
</div>
<div class="single-submit">
<input name="formSubmit1" type="button" class="form-control text-center" id="formSubmit1" value="Submit" alt="">
</div>