title: PHP Success message after submit
body: <p>I'm using a simple php code to send mail from my website</p>
  
  <pre><code>    &lt;?php 
  
      $headers ="From:&lt;$from&gt;\n";
      $headers.="MIME-Version: 1.0\n";
      $headers.="Content-type: text/html; charset=iso 8859-1";
  
      mail($to,$subject,$body,$headers,"-f$from");
  
  
      $name = $_POST['name'];
      $email = $_POST['email'];
      $message = $_POST['message'];
      $formcontent="From: $name \n Message: $message";
      $recipient = "contato@pedrogps.com";
      $subject = "Contact Form";
      $mailheader = "From: $email \r\n";
      mail($recipient, $subject, $formcontent, $mailheader) or die("Error!");
      echo "Thanks for your message";
      ?&gt;
  </code></pre>
  
  <p>when i submit the email, it brings to another page (mail.php) with the "thanks for your message" message.</p>
  
  <p>What can i do to display this message inside my html page without switching pages.</p>