I'm trying to append some items after the contact form is submitted. Unfortunately, I don't know how to tell it what document to append the items to. Here is the full code. Someone able to help?
<?php
$field_name = $_POST['name'];
$field_email = $_POST['email'];
$field_message = $_POST['message'];
$mail_to = 'contact@jeremyblaze.com';
$subject = 'Support Request';
$body_message = 'From: '.$field_name."\n";
$body_message .= 'Email: '.$field_email."\n";
$body_message .= 'Message: '.$field_message;
$headers = 'From: '.$field_email."\r\n";
$headers .= 'Reply-To: '.$field_email."\r\n";
$mail_status = mail($mail_to, $subject, $body_message, $headers);
if ($mail_status) { ?>
<script type="text/javascript">
$(document).ready(function() {
$("#submit").append("<p class='success'>Thanks! Your email has been sent.</p>");
});
</script>
<?php
}
else { ?>
<script type="text/javascript">
$(document).ready(function() {
$("#submit").append("<p class='error'>Sorry, something has gone wrong.</p>");
});
</script>
<?php
}
?>