title: Success Message display on submit html form
body: <p>I am trying to display a success message just above the submit button, but it’s directing me to a form page. Here it is.</p>
  <p>I am trying to:</p>
  <pre class="lang-html prettyprint-override"><code>&lt;!-- The form is on the deck.html page --&gt;
  &lt;div class=&quot;row footer-newsletter justify-content-center&quot;&gt;
      &lt;div class=&quot;col-lg-6&quot;&gt;
          &lt;form action=&quot;forms/subscribe.php&quot; method=&quot;post&quot;&gt;
              &lt;input type=&quot;email&quot; name=&quot;email&quot; placeholder=&quot;Enter your Email&quot;&gt;&lt;input type=&quot;submit&quot; value=&quot;Subscribe&quot;&gt;
          &lt;/form&gt;
      &lt;/div&gt;
  </code></pre>
  <p>I am getting form inputs on my email, so where am I wrong in the below code?</p>
  <pre class="lang-none prettyprint-override"><code>    // Create email headers
      $headers = 'From: ' . $email_from . &quot;\r\n&quot; .
      'Reply-To: ' . $email_from . &quot;\r\n&quot; .
      'X-Mailer: PHP/' . phpversion();
      @mail($email_to, $email_subject, $email_message, $headers);
  ?&gt;
  
  &lt;!-- include your own success HTML here.
  
      So I am getting form details to email, but the success
      message below is appearing on /forms/subscribe.php
      where actually I am looking to display just above
      button
  
  --&gt;
  
      Thank you for contacting us. We will be in touch with you very soon.
  
  &lt;?php
  </code></pre>
  <p>I tried on submit pop up, alert box, but it always took me to the subscribe page and I am looking to display just before the subscribe button.</p>
  <p><a href="https://i.stack.imgur.com/adnp8.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/adnp8.png" alt="Here is the image" /></a></p>