title: PHP how to prevent page redirection after mail send?
body: <p>I've got 2 seperate file with same code. contact.html and contact.php
  I used contact.html for ajax call to load content inside, and contact.php for sending a mail. But I don't want to people redirect to contact.php cause page is crashed. (you can also try to fill the forms and see my problem)
  What I want to; Is it possible to give "message sent successfully" message bottom of the send button and still stay in the same page with no redirect?</p>
  
  <p><a href="http://unidef.com.tr/yy/#contact" rel="nofollow" title="link">click here to see the page</a>         </p>
  
  <p>content/contact.php and content/contact.html code</p>
  
  <pre><code>&lt;div class="section group"&gt;
          &lt;!-- Contact Form --&gt;
          &lt;div id="contact-form" class="col span_6_of_12"&gt;
              &lt;h2 class="main-heading"&gt;
                  &lt;span&gt;&lt;i class="fa fa-envelope"&gt;&lt;/i&gt; Contact Me!&lt;/span&gt;
              &lt;/h2&gt;
  &lt;?php
  if (isset($_REQUEST['email']))
  //if "email" is filled out, send email
    {
    //send email
    $email = $_REQUEST['email'] ;
    $subject = $_REQUEST['subject'] ;
    $message = $_REQUEST['message'] ;
    mail("hiamina@asdkasd.com", $subject,
    $message, "From:" . $email);
    echo "Thank you for using our mail form";
    }
  ?&gt;  
  
  
     &lt;form method="post" action="content/contact.php" id="contactform"&gt;
                  &lt;p&gt;
                      &lt;label for="name"&gt;
                          &lt;b&gt; Your Name&lt;/b&gt;
                      &lt;/label&gt;
                      &lt;br&gt;
                      &lt;input type="name" name="name" class="input" placeholder="type here"&gt;
                  &lt;/p&gt;
                  &lt;p&gt;
                      &lt;label for="email"&gt;
                          &lt;b&gt; Your Email&lt;/b&gt;
                      &lt;/label&gt;
                      &lt;br&gt;
                      &lt;input type="email" name="email" class="input" placeholder="type here"&gt;
                  &lt;/p&gt;
                  &lt;p&gt;
                      &lt;label for="message"&gt;
                          &lt;b&gt; Your Message&lt;/b&gt;
                      &lt;/label&gt;
                      &lt;br&gt;
                      &lt;textarea name="message" cols="60" rows="6" id="textarea"&gt;&lt;/textarea&gt;
                  &lt;/p&gt;
                  &lt;input type="submit" id="submit" name="send" value="Send your message" class="send"&gt;
              &lt;/form&gt;
  
  
  
  
          &lt;/div&gt;
      &lt;!-- /Contact Form --&gt;
  
  
              &lt;div id="space" class="col span_1_of_12"&gt;&lt;/div&gt;
  
  
          &lt;!-- Adress --&gt;
          &lt;div id="adress-container" class="col span_5_of_12"&gt;
  
              &lt;h3&gt;&lt;i class="fa fa-users"&gt;&lt;/i&gt; Get in touch&lt;/h3&gt;
              &lt;hr&gt;
              &lt;p&gt;Malis do cernantur qui cillum ullamco sed aliqua fore. Quem in ubi illum doctrina, consequat id multos tempor, senserit multos te admodum comprehenderit, an quem lorem o incurreret ut multos comprehenderit fabulas eram voluptate hic&lt;/p&gt;
  
          &lt;/div&gt;
          &lt;!-- /Adress --&gt;
  
      &lt;/div&gt;
  </code></pre>