I am a real novice when it comes to webdesign and thought I properly reproduced the sample code for a basic "contact us" form, but it's not working for some reason. Can someone please, please give me a hand? We are potentially losing business if I can't get this form up and running.
Here is the HTML code:
<form method="post" action="contact.php" id="contactform">
<div>
<p>Please complete as many fields as possible. Thank you!</p>
</div>
<div>
<label>Name <span class="required">*</span></label>
<input name="name" type="text" id="name" value="" />
</div>
<div>
<label>Email <span class="required">*</span></label>
<input name="email" type="text" id="email" value="" />
</div>
<div>
<label>Cell phone</label>
<input name="cell" type="text" id="cell" value="" />
</div>
<div>
<label>Home phone</label>
<input name="home" type="text" id="home" value="" />
</div>
<div>
<label>How can we help you? <span class="required">*</span></label>
<textarea name="message" rows="20" cols="50" id="message" ></textarea><br /><br />
</div>
<div>
<input type="submit" value="Submit" class="button">
<input type="reset" value="Reset" class="button">
</div>
</form>
And here is the PHP code:
<?php
if(isset($_POST['submit'])) {
$to = "info@eternityglass.com";
$subject = "Question about Eternity Glass";
$name_field = $_POST['name'];
$email_field = $_POST['email'];
$cell_field = $_POST['cell'];
$home_field = $_POST['home'];
$message = $_POST['message'];
$body = "From: $name_field\n Email: $email_field\n Cell #: $cell_field\n Home: $Home #: $home_field\n Message:\n $message";
echo "Thank you, we will get back to you shortly";
mail($to, $subject, $body);
} else {
echo "Error!";
}
?>
Help!