The modal form below gets stuck on submitting.... It also doesn't actually send the message to my email. I am relatively new to PHP, but I assume this problem pertains to my sendmessage.php
file(below). For whatever reason, the tutorial states to not apply an action. What coud I be doing wrong?
Just FYI, my header contains scripts to jquery.fancybox.js?v=2.0.6
and ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js
sendmessage.php file:
<?php
$sendto = "jjaylad@me.com";
$usermail = $_POST['email'];
$content = nl2br($_POST['msg']);
$subject = "New Feedback Message";
$headers = "From: " . strip_tags($usermail) . "\r\n";
$headers .= "Reply-To: ". strip_tags($usermail) . "\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html;charset=utf-8 \r\n";
$msg = "<html><body style='font-family:Arial,sans-serif;'>";
$msg .= "<h2 style='font-weight:bold;border-bottom:1px dotted #ccc;'>New User Feedback</h2>\r\n";
$msg .= "<p><strong>Sent by:</strong> ".$usermail."</p>\r\n";
$msg .= "<p><strong>Message:</strong> ".$content."</p>\r\n";
$msg .= "</body></html>";
if(@mail($sendto, $subject, $msg, $headers)) {
echo "true";
} else {
echo "false";
}
?>
Contact form code:
<form id="contact" name="contact" action="#" method="post">
<label for="email">Your E-mail Address:</label>
<input type="email" id="email" name="email" class="txt">
<br>
<label for="msg">Inquiry:</label>
<textarea id="msg" name="msg" class="txtarea"></textarea>
<button id="send">Send E-mail</button>
</form>