title: How to echo on same html page after form submit?
body: <p>When the form is submitted, my page is redirected to the PHP and the echo is displayed. How can I display the echo without being redirected to the PHP page? So the echo should be displayed in the html page (where the html form is located).</p>
  
  <pre><code>&lt;form method="post" action="../form.php"&gt;
  &lt;input type="submit" name="1" value="YES" /&gt;
  &lt;input type="submit" name="1" value="NO" /&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>-</p>
  
  <pre><code>&lt;?php 
  $answer = $_POST['1'];  
  if ($answer == "YES") {          
      echo 'Good!!!';      
  }
  else {
      echo 'Try Again!';
  } 
  ?&gt;
  </code></pre>