title: Jump to HTML anchor automatically when PHP form submits
body: <p>I am trying to add a form into my index page, so that when you click on submit it will automatically return to the form when the page reloads.  Right now if there are any errors on the page it will display them right above the form as well as give a little thank you message.</p>
  
  <p>I currently have the following for the index.html page:</p>
  
  <pre><code>&lt;?php
      include "check.php";
  ?&gt;
  &lt;form method="post" action="&lt;?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?&gt;"&gt;
      Name:&lt;br/&gt; &lt;input type="text" name="name" value="&lt;?php echo $_POST['name']; ?&gt;" size="30" /&gt;&lt;br/&gt;&lt;br/&gt;
      Email Address:&lt;br/&gt; &lt;input type="text" name="email" value="&lt;?php echo $_POST['email']; ?&gt;" size="30"/&gt; &lt;br/&gt;&lt;br/&gt;
      Company Name:&lt;br/&gt; &lt;input type="text" name="companyName" value="&lt;?php echo $_POST['companyname']; ?&gt;" size="30" /&gt; &lt;br/&gt;&lt;br/&gt;
      Message:&lt;br/&gt;
      &lt;textarea style="resize: none;" name="message" rows="5" cols="30"&gt;&lt;?php echo $_POST['message']; ?&gt;&lt;/textarea&gt;
      &lt;br/&gt;
      &lt;input type="submit" name="Submit" /&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>When I submit the page it will run through the check.php file and verify all the data is good.  It should then return the following If/Then statement if all the conditions are met.</p>
  
  <pre><code>if (!$errors) {
      $mail_to = 'test@test.com';
      $subject = 'New Mail from Form Submission';
      $message  = 'From: ' . $_POST['name'] . "\n";
      $message .= 'Email: ' . $_POST['email'] . "\n";
      $message .= 'Company Name: ' . $_POST['companyname'] . "\n";
      $message .= "Message:\n" . $_POST['message'] . "\n\n";
      mail($mail_to, $subject, $message);
  
      echo "Thank you for your email!&lt;br/&gt;&lt;br/&gt;";
      $_POST = array(); //Clear form after submit
  
  } else {
      echo '&lt;div style="color: red"&gt;' . $errors . '&lt;br/&gt;&lt;/div&gt;';
  }
  </code></pre>
  
  <p>Is there anyway to add an auto-function during the "thank you" or "error" echos that will automatically bring the person back down to the contact form?</p>
  
  <p>I hope I explained what I wanted to do correctly.  If not please let me know and I will try to clarify it a bit better.</p>