title: How to get success message after submit
body: <p>Recently, I’ve been working with a lot of form confirmations. I’ve been thinking about the best way on how to approach these. Many forms redirect users either to a separate page displaying a thank you/confirmation message </p>
  
  <p>i want to show mgs in same page . I have tried below code but i am not getting sucess mgs on same page. it redirect to contriler.php page</p>
  
  <p>javascript file</p>
  
  <pre><code>&lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"&gt;&lt;/script&gt;
      &lt;script&gt;
      $(document).ready(function(){
          $("#Button1").click(function(event){
              $(".message").show();
              $(".message").fadeOut(2500);
          });
      });
  &lt;/script&gt;
  </code></pre>
  
  <p>html file</p>
  
  <pre><code>&lt;div class="w-form"&gt;
      &lt;form method="POST" name="contactform" action="contact-form-handler.php" class="myform form-tablet" id="email-form" data-name="Email Form"&gt;
          &lt;select class="w-select form-select-field" id="Selection" name="Selection" required="required" data-name="Selection"&gt;
              &lt;option value="start project"&gt;Start Project&lt;/option&gt;
              &lt;option value="work with us"&gt;Work with us&lt;/option&gt;
              &lt;option value="just say yello"&gt;Just say hello&lt;/option&gt;
          &lt;/select&gt;
          &lt;label class="labelfield" for="Name-3"&gt;*your Name:&lt;/label&gt;
          &lt;input class="w-input textfield" id="Name-3" type="text" name="Name" data-name="Name" required="required"&gt;
          &lt;label class="labelfield" for="Email-3"&gt;*Your e-mail address&lt;/label&gt;
          &lt;input class="w-input textfield" id="Email-3" type="email" name="Email" data-name="Email" required="required"&gt;
          &lt;label class="labelfield" for="Web"&gt;Your Website&lt;/label&gt;
          &lt;input class="w-input textfield" id="Web" type="text" name="Web" data-name="Web"&gt;
          &lt;label class="labelfield" for="Message"&gt;Your Message to Us&lt;/label&gt;
          &lt;textarea class="w-input textfield comment" id="Message" name="Message" data-name="Message"&gt;&lt;/textarea&gt;
          &lt;input id="Button1" class="w-button submit-button" type="submit" value="Submit" data-wait="Please wait..."&gt;
  
  
      &lt;/form&gt;
      &lt;div class="message"&gt;Your update was successful.&lt;/div&gt;
  </code></pre>
  
  <p></p>
  
  <pre><code>controler.php file
  
  &lt;?php 
  $errors = '';
  
  $myemail = 'omprakash.k@fuegosys.com  ';//&lt;-----Put Your email address here.
  $Selection=($_POST['Selection']);
  $name=($_POST['Name']);
  $email_address=($_POST['Email']);
  $Web=($_POST['Web']);
  $message=($_POST['Web']);
  
  if( empty($errors))
  {
      $to = $myemail; 
      $email_subject = "Contact form submission: $name";
      $email_body = "You have received a new message. ".
      "$myemail /n $Selection /n $name /n $email_address/n $Web/n  $message"; 
  
      $headers = "From: $myemail\n"; 
      $headers .= "Reply-To: $email_address";
  
      mail($to,$email_subject,$email_body,$headers);
      //redirect to the 'thank you' page
      header('Location: index.html#contact');
  } 
  ?&gt;
  &lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt; 
  &lt;html&gt;
  
  
  &lt;body&gt;
  &lt;!-- This page is displayed only if there is some error --&gt;
  &lt;?php
  echo nl2br($errors);
  ?&gt;
  
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>My Problem is it not rederting tohome page with sucess mgs</p>