Hello, I'm new to php and I'm trying to code my first contact form. The only problem I have is that I receive no email when I test it on my server. I have an index.php file and a handle_form.php file.
Here is my code... Am I doing something wrong? I deleted my email for spam purposes to post my code...
I have also used a php mail tester and it did work.....
Thanks
index.php
<div id="contactForm" class="container">
<form action="handle_form.php" method="post">
<fieldset><legend>Enter your information below:</legend>
<table>
<tr>
<td><p>Name: </td> <td><input type="text" name="name" size="30" max length:"40" /> </p> </td></tr>
<tr>
<td><p>Phone: </td> <td> <input type="text" name="phone" size="30" max length:"40"> </p> </td></tr>
<tr>
<td><p>Email: </td> <td> <input type="text" name"email" size="30" max length:"60" /> </p> </td></tr>
<tr>
<td><p>Project Details: </td> <td> <textarea name="details" rows="8" cols="30"></textarea> </p> </td></tr>
<tr> <td> <input type="submit" name"submit" value="Submit" /> </td> </tr>
</table>
</form>
</div><!-- end of contactForm -->
handle_form.php
<?php
$name = $_POST['name'];
$phone = $_POST['phone'];
$email = $_POST['email'];
$details = $_POST['details'];
$to = 'example@gmail.com';
$subject = "New message: $name";
$message = "$name said: $details";
$headers = "From: $email";
mail($to, $subject, $message, $headers);
header("Location: ");
?>