I have been trying to figure out on what is missing in my codes. Basically whenever i click the submit button to send the data in the contact form, it basically returns me to the home page and displays "page not found" in the tab. 

Here is my code

```
<?php 
$error=false;
$sent=false;
if(isset($_POST['submit'])) {
if(empty($_POST['name']) || empty($_POST['email']) || empty($_POST['message'])) {
    $error = true;
} else {

 $to = "noel@digitalspin.ph";

 $name = trim($_POST['name']);
 $email = trim($_POST['email']);
 $message = trim($_POST['message']);

 $messages ="\r\n Name: $name \r\n Email: $email \r\n Message: $message";
 $headers = "From:" . $name;
 $mailsent = mail($to, $subject, $message, $headers);

 if($mailsent){
     $sent= true;
    }
  }
}
?>

```

Here is my Markup codes

```
<div class="col10">
<div class="contact_form">
<h2>Inquiries/Comments/Suggestions</h2>
<form id="register-form" action="" method="post">

    <?php if($error == true) { ?>
    <p class="error"> There are some misisng fields.</p>
    <?php } if($sent == true) { ?>
    <p class="sent">Thank you for sending your message</p><?php } ?>

    <div class="contact-form">
    <input type="text" name="name" placeholder="Name">

    <input type="text" name="email" placeholder="Email">

    <textarea name="message" placeholder="Message"></textarea>

    <label>Where did you learn about us?</label>

    <select>
        <option>Word of Mouth</option>
        <option>Billboards</option>
        <option>Roadshows</option>
        <option>Sales agents</option>
        <option>TV ads</option>
        <option>Booths/Exhibits</option>
        <option>Print Ads</option>
        <option>Internet</option>
        <option>Direct Mail</option>
        <option>Flyer</option>
        <option>Referral</option>
        <option>Others</option>
    </select>

    <input type="submit" value="send" name="submit">

</form>
</div>
</div>

</div>

```