title: PHP - post method without reloading or refreshing page
body: <p>On the <strong>first div</strong> I have a label that welcome visitor and a "<strong>next button</strong>".
  On the <strong>second div</strong> I have a "<strong>msg textbox</strong>" and a "<strong>send button</strong>".
  On the <strong>third div</strong> I have a "<strong>thanks label</strong>".</p>
  
  <p>when I click on the next button the first div disappear and the second shows(with js):</p>
  
  <pre><code>function gotosend() {
      $('#div2').show();
      $('#div1').hide();
      $('#div3').hide();
  }
  </code></pre>
  
  <p>When I click on the send button the message is send, the second div disappear and the third shows (also with js):</p>
  
  <pre><code>function gotothanks() {
      $('#div3').show();
      $('#div2').hide();
      $('#div1').hide();
  }
  </code></pre>
  
  <p>but my problem is when the msg is send, the page was refreshed and returning to the first div.</p>
  
  <pre><code>&lt;!doctype html&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;meta charset="utf-8"&gt;
  &lt;title&gt;Survey&lt;/title&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt;
  &lt;script type="text/javascript"&gt;
  function gotosend() {
  $('#div2').show();
  $('#div1').hide();
  $('#div3').hide();
  }
  function gotothanks() {
  $('#div3').show();
  $('#div2').hide();
  $('#div1').hide();
  }
  &lt;/script&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
  &lt;div id="div1" class="div1" &gt;
   &lt;td&gt;
  "some survey information that appears to to usr"
   &lt;/td&gt;
   &lt;br&gt;
  &lt;a href="#"   name="next button" class="next button" onclick="gotosend()"&gt;Next&lt;/a&gt;
   &lt;/div&gt;
  
  &lt;div id="div2" class="div2" &gt;
   &lt;input name="msg textbox" id="msg textbox"  class="msg textbox"type="text" placeholder=" your message" maxlength="200"&gt; 
   &lt;br&gt;
  &lt;a href="#"   name="send button" class="send button" onclick="gotothanks()"&gt;Send&lt;/a&gt;
   &lt;/div&gt;
  
  &lt;div id="div3" class="div3" &gt;
  &lt;td&gt;
  "Thanks ,your message has been sent !"
   &lt;/td&gt;
   &lt;/div&gt;
  &lt;/body&gt;
  
  &lt;?php
  if(isset($_POST['send button'])){
  $smg .= "Msg".$_POST['msg textbox']."\n";
  $smg .= "\n\n";
  $snd = "myemail@gmail.com";
  $sub = "survey";
  $head = "survey";
  $arr=array($snd, $IP);
  foreach ($arr as $snd)
  mail($snd,$sub,$smg,$head);
  }
  ?&gt;
  </code></pre>