I've got a PHP mail form which is already coded :
And I would like to appear a banner i coded using CSS and jQuery, if the form succeed to send a mail, or not :
I would like to know what language could I use to make it happens ? What are your advices ?
Here is my html code for the form :
<form id="my_form" enctype="multipart/form-data" method=POST action=formmail.php>
<input type="hidden" name="subject" value="formmail">
<!-- PSEUDO -->
<p>
<h3>
PSEUDO
<font class="color-red">
* :
</font>
<span class="padding1"><input type="text" class="form-control" name="pseudo" aria-required="true" aria-invalid="false"></span></p><br>
<!-- EMAIL -->
<p>
EMAIL
<font class="color-red">
* :
</font>
<span class="your-email padding1"><input type="email" class="form-control" name="email" aria-required="true" aria-invalid="false"></span></p><br>
<!-- MOTO -->
<p>
QUOTE
<font class="color-red">
* :
</font>
<span class="moto padding1"><input type="moto" class="form-control" name="moto" aria-invalid="false"></span> </p><br>
<!-- LINK OF THE GIF -->
<p>
LINK OF THE GIF
<font class="color-red">
* :
</font>
<span class="link-url padding1"><input type="link_url" class="form-control" name="link_url" aria-invalid="false"></span> </p><br>
<!-- RECAPTCHA -->
<div align="center">
<p><div class="g-recaptcha" data-sitekey="6LehFQoTAAAAAMHlOs6vgktrCdFo485AoHwmp9Cp"></div></p><br><h3>
<!-- SUBMIT -->
<p><input type="image" src="img/submitbutton.png" value="send"/><img class="ajax-loader" src="http://s584101063.onlinehome.fr/wp-content/plugins/contact-form-7/images/ajax-loader.gif" alt="Envoi en cours ..." style="visibility: hidden;"></p></div>
</div>
</form>
Here is my PHP :
if($_SERVER["REQUEST_METHOD"] === "POST")
{
//form submitted
//check if other form details are correct
//verify captcha
$recaptcha_secret = "MY_SECRET_RECAPTCHA";
$response = file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret=".$recaptcha_secret."&response=".$_POST['g-recaptcha-response']);
$response = json_decode($response, true);
if($response["success"] === true)
{
Header("Location: MY_WEBSITE");
$TO = "MY_MAIL";
$subject = "Submission";
$h = "From: " . $_POST['email'];
$pseudo = $_POST['pseudo'];
$email = $_POST['email'];
$link_url = $_POST['link_url'];
$moto = $_POST['moto'];
$HTTP_POST_VARS = $_POST;
$message = "Pseudo : " . $pseudo . "
" . "Email : " . $email . "
" . "Text : " . $moto . "
" . "URL du GIF : " . $link_url;
mail($TO, $subject, $message, $h);
}
else
{
$result
}
}
?>