Thanks for the reply.
So i managed to get a hold of the following code for a send_email.php file:
Code:
<?php
$field_name = $_POST['cf_name'];
$field_email = $_POST['cf_email'];
$field_message = $_POST['cf_message'];
$mail_to = 'sam@example.com';
$subject = 'Message from a site visitor '.$field_name;
$body_message = 'From: '.$field_name."\n";
$body_message .= 'E-mail: '.$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 language="javascript" type="text/javascript">
alert('Thank you for the message. We will contact you shortly.');
window.location = 'contact_page.html';
</script>
<?php
}
else { ?>
<script language="javascript" type="text/javascript">
alert('Message failed. Please, send an email to sam@example.com');
window.location = 'contact_page.html';
</script>
<?php
}
?>
Now, when I fill out the form on my website I get a reply sent to my email but it looks like this
- Anyway I can modify this php code so that I can get the filled out fields as described in the html further above to display instead of these blank fields?
Bookmarks