Need some help, made one mailer form on my website classiccarbines.com to work but cannot get the simple contact us form to function without error. I am sure I am missing something simple but I have looked too long and as a self taught hack cannot resolve this one.
Form code:
<h2>Contact Form</h2>
<form id="form" action="contactmailer.php" method="post" >
<fieldset>
<label><input type="text" id="Name" value="Name" onBlur="if(this.value=='') this.value='Name'" onFocus="if(this.value =='Name' ) this.value=''"></label>
<label><input type="text" id="Email" value="Email" onBlur="if(this.value=='') this.value='Email'" onFocus="if(this.value =='Email' ) this.value=''"></label>
<label><input type="text" id="Phone" value="Phone" onBlur="if(this.value=='') this.value='Phone'" onFocus="if(this.value =='Phone' ) this.value=''"></label>
<label><textarea onBlur="if(this.value==''){this.value='MESSAGE'}" onFocus="if(this.value=='MESSAGE'){this.value=''}" id="message">MESSAGE</textarea></label>
<div class="btns"><a href="#" class="button">Clear</a><a href="#" class="button" onClick="document.getElementById('form').submit();">Send</a></div>
</fieldset>
</form>
PHP Script:
<?php
if(isset($_POST['submit'])) {
$to = "email@email.com";
$subject = "Classic Carbines Quote Inquiry";
$name = $_POST['name'];
$phone = $_POST['phone'];
$email = $_POST['email'];
$message = $_POST['message'];
$body = "Name: $name\n Phone: $phone\n Email: $email\n Messge: $message";
mail($to, $subject, $body);
header('Location: infosent.html');
}else{
echo "error! :'(";
}
?>
Please help, and thank you in advance