3
I’m having the following problems in the form I’ve assembled:
- The form is not sent to the email.
- After clicking on Ubmit, pressing to reload the page gives the conflict of "Confirm the resubmit of the form".
That is the Code:
<div class="form-dicas">
<div class="sombra"></div>
<div class="wrp-dicas clearfix">
<div id="dicas" class="dicas">
<img class="botao-fechar-x" src="images/botao-x.png">
<?php
if (isset($_POST['submit'])) {
unset($_POST['submit']);
$name = $_POST['name'];
$email = $_POST['email'];
$facebook = $_POST['facebook'];
$twitter = $_POST['twitter'];
$msg = $_POST['msg'];
$headers = "From: ".$email."\r\n";
$headers .= "MIME-Version: 1.0";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$subject = "Formulário de - ".$name;
$corpo = "Nome: " . $name . "\n";
$corpo .= "Email: " . $email . "\n";
$corpo .= "Facebook: " . $facebook . "\n";
$corpo .= "twitter: " . $twitter . "\n";
$corpo .= "Mensagem: " . $msg . "\n";
$email_to = '[email protected]';
mail($email_to, $subject, $corpo, $headers);
}
?>
<form action="" method="post">
<ul>
<li class="name">
<label for="name">Nome:</label>
<input required id="name" name="name" type="text" />
</li>
<li class="facebook">
<label for="facebook">Facebook (opcional):</label>
<input id="facebook" name="facebook" type="text" />
</li>
<li class="twitter">
<label for="twitter">Twitter (opcional):</label>
<input id="twitter" name="twitter" type="text" />
</li>
<li class="email">
<label for="email">E-mail:</label>
<input required id="email" name="email" type="text" />
</li>
<li class="msg">
<label for="msg">Mensagem:</label>
<textarea required id="msg" name="msg" type="text"></textarea>
</li>
<li class="submit">
<input id="send_form" type="submit" name="submit" value="Enviar" />
</li>
</ul>
</form>
</div><!-- div wrp-dicas -->
</div><!-- div sombra -->
</div><!-- div form-dicas -->
There’s also a little bit of jquery, which I think is irrelevant, but here it is:
<script type="text/javascript">
var $j = jQuery.noConflict();
$j(document).ready(function() {
$j(".clique-aqui").click(function() {
$j(".form-dicas").fadeIn('slow');
});
$j(".botao-fechar-x").click(function() {
$j(".form-dicas").fadeOut("slow");
});
$j(document).bind('keydown', function(e) {
if (e.which == 27) {
$j(".form-dicas").fadeOut("slow");
}
});
});
</script>
I’m using the xampp
to test this form, could help me in what I did wrong?
Thanks!
The email server has been configured in windows?
– rray
@rray How so? I’m at work and had a functional form tested with shampoo here recently but it’s been lost and I’m trying to redo it. I tested with my personal email and worked the old form.
– Luna Laura