title: The redirect to thank you page is not working in my PHP code, using template
body: <p>I am new to PHP. I have been using this example from a website and the redirect to thank you page is not working, can anyone solve why? Also I'm not getting the email to myself either, I have got the example code from: <a href="http://form.guide/email-form/html-email-form.html" rel="nofollow noreferrer">http://form.guide/email-form/html-email-form.html</a> </p>
  
  <p>After downloading the full code it just redirects to the PHP codes instead of going to the thank you page.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>if( empty($errors))
  {
   $to = $myemail; 
   $email_subject = "Contact form submission: $firstname";
   $email_body = "You have received a new message. ".
   " Here are the details:\n Name: $firstname \n Email: $email_address \n Message \n $message"; 
   
   $headers = "From: $myemail\n"; 
   $headers .= "Reply-To: $email_address";
   
   mail($to,$email_subject,$email_body,$headers);
   //redirect to the 'thank you' page
   header('Location: contact-form-thank-you.html');
  } 
  ?&gt;
  &lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt; 
  &lt;html&gt;
  &lt;head&gt;
   &lt;title&gt;Contact form handler&lt;/title&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
  &lt;!-- This page is displayed only if there is some error --&gt;
  &lt;?php
  echo nl2br($errors);
  ?&gt;
  
  
  &lt;/body&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>