Hi, I am a bit of a novice in PHP, but i am having blank emails sent to my email address, is anyone able to tell me where i am going wrong? My codes below:
PHP
<?php
$field_name = $_POST['full_name'];
$field_email = $_POST['email'];
$field_telephone = $_POST['telephone'];
$field_message = $_POST['message'];
$mail_to = 'shaun_o_c@yahoo.co.uk';
$subject = 'Contact form'.$field_name;
$body_message = 'From: '.$field_name."\n";
$body_message .= 'E-mail: '.$field_email."\n";
$body_message .= 'Message: '.$field_message;
$headers = 'From: '.$cf_email."\r\n";
$headers .= 'Reply-To: '.$cf_email."\r\n";
$mail_status = mail($mail_to, $subject, $body_message, $headers);
if ($mail_status) { ?>
<script language="javascript" type="text/javascript">
alert('Thank You.');
window.location = 'index-4.html';
</script>
<?php
}
else { ?>
<script language="javascript" type="text/javascript">
alert('Fail ba');
window.location = 'index-4.html';
</script>
<?php
}
?>
HTML
<h2>Contact Form</h2>
<form id="ContactForm" action="contact.php" enctype="multipart/form-data">
<div>
<div class="rows"><input name="full_name" class="input" type="text" value="Name:" onblur="if(this.value=='') this.value='Enter your Name:'" onFocus="if(this.value =='Enter your Name:' ) this.value=''" /></div>
<div class="rows"><input class="email" type="text" value="E-mail :" onblur="if(this.value=='') this.value='Enter your E-mail:'" onFocus="if(this.value =='Enter your E-mail:' ) this.value=''" /></div>
<div class="rows"><input class="relephone" type="text" value="Telephone (optional):" onblur="if(this.value=='') this.value='Enter your Phone:'" onFocus="if(this.value =='Enter your Phone:' ) this.value=''" /></div>
<div class="textarea_box"><textarea name="message" cols="1" rows="1" onBlur="if(this.value=='') this.value='Enter your Message:'" onFocus="if(this.value =='Enter your Message:' ) this.value=''" >Skriv inn din melding:</textarea></div>
<a href="#" class="link1" onClick="document.getElementById('ContactForm').reset()">Reset</a>
<a href="#" class="link1" onClick="document.getElementById('ContactForm').submit()">Send</a>
</div>
</form>


