title: PHP form submission returns blank
body: <p>I'm a total novice so please bear with me :)…I've managed to create a form and used PHP to send the data to an email address. However, once I click submit; the screen goes blank instead of staying on the current page and displaying a message. I'm guessing i'm missing some sort of PHP code?</p>
  
  <p>Also, i'd like to use the JQuery validator plugin on my form, how can I add it without basically screwing up the form?</p>
  
  <p>MY HTML:</p>
  
  <pre><code>&lt;div&gt;
  &lt;form id="form_id" name="form_name" action="scripts/index.php" method="post"&gt;
                  &lt;div&gt;
                      &lt;label for="name"&gt;Name: &lt;/label&gt;
                      &lt;input type="text" name="name" id="name" placeholder="John Smith" required/&gt;
                  &lt;/div&gt;
  
                  &lt;div&gt;
                      &lt;label for="email"&gt;Email: &lt;/label&gt;
                      &lt;input type="email" name="email" id="email" placeholder="name@mail.com" required/&gt;
                  &lt;/div&gt;
  
                  &lt;div&gt;
                      &lt;label for="message"&gt;Message: &lt;/label&gt;
                      &lt;textarea name="message" id="message" rows="5" cols="30"&gt;&lt;/textarea&gt;
                  &lt;/div&gt;
  
                  &lt;div&gt;
                      &lt;input id="submit" type="submit" name="submit" value="submit" /&gt;
                  &lt;/div&gt;
              &lt;/form&gt;
              &lt;p id="feedback"&gt;&lt;?php echo $feedback; ?&gt;&lt;/p&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>MY PHP:</p>
  
  <pre><code>&lt;?php
  
  $to = 'example@gmail.com';
  $subject = 'Message from The Rocket Factory';
  
  $name = $_POST['name'];
  $email = $_POST['email'];
  $message = $_POST['message'];
  
  $body = &lt;&lt;&lt;EMAIL
  
  Hi, my name is $name.
  
  $message
  
  From $name
  My Address is $email
  
  
  EMAIL;
  
  $header = "From: $email";
  
  if($_POST){
      mail($to, $subject, $body, $header);
      $feedback = 'Thanks for your message';
  }
  
  ?&gt;
  </code></pre>