This form code will not send emails...
This is the HTML Form:
<form method="post" action="index.php">
<table class="form">
<tr>
<th class="label">
<label for="name">Name</label>
</th>
<td class="input">
<input type="text" name="name" id="name">
</td>
</tr>
<tr>
<th class="label">
<label for="email">Email</label>
</th>
<td class="input">
<input type="text" name="email" id="email">
</td>
</tr>
<tr>
<th class="label">
<label for="message">Message</label>
</th>
<td class="input">
<textarea type="text" name="message" id="message"></textarea>
</td>
</tr>
</table>
<input type="submit" value="Send">
</form>
Here is the send code:
<?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$name = $_POST["name"];
$email = $_POST["email"];
$message = $_POST["message"];
$email_body = "";
$email_body = $email_body . "Name: " . $name;
$email_body = $email_body . "Email: " . $email;
$email_body = $email_body . "Message: " . $message;
mail("myemail@email.com" , "Contact Form" , $message , "From: $name");
header("Location: index.php?formsubmit=1");
exit;
}
?>
I'm not at all sure what is wrong, it worked before, but after I tried adding some things to my code, like a thing that said if form submit is equal to one display thanks for contacting us instead of explaining the form. That should not have anything to do with it though, I wouldn't think...
Could it be the fact that I added the whole ?formsubmit=1 thing?
Thanks for any help.