Hi guys
I'm a total noob and have spent an incredible amount of time (to no avail) trying to get the contact form I have on my website working.
I downloaded a website template ( template 473 november ) and understand that I require a send_email.php page but cannot get it working!
Here is the code for the html part of my website where the contact form resides
HTML
…………………………………………………………………………………………………………………………………………………….
<form action="send_email.php" method="post">
<fieldset>
<p><input type="text" value="" placeholder="NAME" class="field"></p>
<p><input type="email" value="" placeholder="EMAIL" class="field"></p>
<p><input type="text" value="" placeholder="TITLE" class="field"></p>
<p><textarea cols="2" rows="2" placeholder="MESSAGE"></textarea></p>
<p><input type="submit" value="send" class="button"></p>
</fieldset>
</form>
…………………………………………………………………………………………………………………………………………………….
Can anyone provide me with what I would require to put into send_email.php to get this working?
I tried the below unrelated code that I found on another site for my send_email.php
PHP CODE
<?php
$field_name = $POST['cf_name'];
$field_email = $POST['cf_email'];
$field_message = $_POST['cf_message'];
$mail_to = 'shane@tirecity.co.za';
$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 gordon@template-help.com');
window.location = 'contact_page.html';
</script>
<?php
}
?>
BUT with the above php code when I fill in the contact form on my website the replies come through to my email with 3 blank fields only stating field names as follows (not even all the correct field names either)..:
From
E-mail
Message[ATTACH]5413[/ATTACH]
Can anyone PLEASE adjust my php code above to correct this problem. I've really searched everywhere around the net and have spent oh so many hours with this template ( WEEKS ACTUALLY ) and only need to get the contact form working
screenshot.png