title: Echo in the same page after using contact form
body: <p>I am working on my website right now and I have encountered a little problem, I am not that great at PHP but managed to put together a contact form that works fine, the code will be below, the thing is that after submitting, I want it to echo on the same page as the button, like underneath it or something like that and I don't quite know how to get there. </p>
  
  <p>Some help please ?</p>
  
  <pre><code>        if ( mail($destination,$subject,$mailMessage,$mailHeader) ) 
          {
              echo "Thank You!";
          }           
          else header('Location: index.html');
  
      }       
      else header('Location: index.html');    
  
  }
  else header('Location: index.html');            
  </code></pre>
  
  <p><strong>PS :</strong></p>
  
  <p>I think i have to change the action attribute to point to itself but I don't quite know how.</p>
  
  <p><strong>Update - Entire code:</strong> </p>
  
  <pre><code>&lt;?php
  
  //EMAIL VALIDATION
  function validateEmail($value){
      return preg_match('/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$/', $value);
  }
  
  //CHECK VARIABLES (EMPTY/NULL OR DEFAULT)
  if ( isset($_POST['last']) &amp;&amp; $_POST['last']!="Nume complet" &amp;&amp; isset($_POST['email']) &amp;&amp; $_POST['email']!="Email" &amp;&amp; isset($_POST['message']) &amp;&amp; $_POST['message']!="Recenzie/Comentariu" ) {
  
      //CHECK EMAIL   
      if ( validateEmail($_POST['email']) ) {
  
  
  
          ////////////////////// EDIT HERE  /////////////////////////
  
          //SET HERE YOUR DESTINATION EMAIL
          //IT SHOULD BE FROM THE SAME DOMAIN WHERE SITE IS HOSTED
          $destination="...@outlook.com";
  
          //SET HERE YOUR EMAIL SUBJECT
          $subject="Colibri";
  
          //MESSAGE DATA (HTML FORMATTED)
          $mailMessage.="&lt;dt&gt;&lt;strong&gt;Nume complet:&lt;/strong&gt;&lt;/dt&gt;&lt;dd&gt;".$_POST['last']."&lt;/dd&gt;";
          $mailMessage.="&lt;dt&gt;&lt;strong&gt;E-mail:&lt;/strong&gt;&lt;/dt&gt;&lt;dd&gt;".$_POST['email']."&lt;/dd&gt;";
          $mailMessage.="&lt;dt&gt;&lt;strong&gt;Recenzie:&lt;/strong&gt;&lt;/dt&gt;&lt;dd&gt;";  
          $mailMessage.=nl2br($_POST['message'])."&lt;/dd&gt;&lt;/dl&gt;";
          $mailMessage = utf8_decode($mailMessage);
  
          ////////////////////// END EDIT  /////////////////////////
  
  
  
          //SENDER EMAIL
          $mailFrom=$_POST['email'];
  
          //HEADER DATA
          $mailHeader="From:".$mailFrom."\nReply-To:".$_POST['name']."&lt;".$mailFrom."&gt;\n"; 
          $mailHeader=$mailHeader."X-Mailer:PHP/".phpversion()."\n"; 
          $mailHeader=$mailHeader."Mime-Version: 1.0\n"; 
          $mailHeader=$mailHeader."Content-Type: text/html";
  
  
          if ( mail($destination,$subject,$mailMessage,$mailHeader) ) 
          {
              echo "Thank You!";
          }           
          else header('Location: index.html');
  
      }       
      else header('Location: index.html');    //EMAIL VALIDATION ERROR
  
  }
  else header('Location: index.html');        //VARS ERROR        
  </code></pre>
  
  <p>?></p>
  
  <p><strong>My HTML</strong></p>
  
  <pre><code>&lt;div class="form"&gt;
    &lt;hr/&gt;
    &lt;form id="myForm" method="post" action="contact_colibri.php"&gt;
      &lt;input type="text" value="Nume complet" id="last" name="last" class="fields" onFocus="if(this.value == 'Nume complet') {this.value = '';}" onBlur="if (this.value == '') {this.value = 'Nume complet';}"&gt;&lt;br/&gt;
  
      &lt;input type="text" value="Email" id="email" name="email" class="fields" onFocus="if(this.value == 'Email') {this.value = '';}" onBlur="if (this.value == '') {this.value = 'Email';}"&gt;&lt;br/&gt;   
  
      &lt;textarea cols="20" rows="5" id="message" name="message" class="fields" onFocus="if(this.value == 'Recenzie/Comentariu') {this.value = '';}" onBlur="if (this.value == '') {this.value = 'Recenzie/Comentariu';}"&gt;Recenzie/Comentariu&lt;/textarea&gt;&lt;br/&gt;
  
      &lt;center&gt;&lt;button class="button"&gt;Trimite&lt;/button&gt;&lt;/center&gt;
  
      &lt;/form&gt;
  
              &lt;/div&gt;
  </code></pre>