title: Redirect after page does it's job
body: <p>I have a php page that does a job after a form is submitted. the form enters data into a database then the next page queries the database and creats and sends an email based on the info entered into the form. I need that page to redirect back to the original form after sending the email.</p>
  
  <pre><code>        &lt;?php
      $con = mysqli_connect('localhost','username','password');
  
  if(!$con)
  {
      echo 'Not Connected To Server';
  }
  if(!mysqli_select_db($con,'dbname'))
  {
      echo 'Database Not Selected';
  }
  
  $Name = $_POST['Name'];
  $Email = $_POST['Email'];
  
  $sql = "INSERT INTO tablename (Name,Email) VALUES ('$Name','$Email')";
  
  if(!mysqli_query($con,$sql))
  {
      echo 'Not Inserted';
  }
  else
  {
      echo 'Blah Blah Blah Yackity Schmackity';
      $id = $con-&gt;insert_id; // Get latest inserted id.
  
      $to      = $Email;
      $subject = 'Subject Line Here';
      $message = '&lt;center&gt;&lt;img src="http://domainname.com/images/Banner.jpg" /&gt; 
  &lt;/center&gt;&lt;br&gt;&lt;br&gt;start of email text here&lt;b&gt; "'.$Name.'"&lt;/b&gt; Your Member ID 
  is "'.$id.'"Rest of email text here.
  ';
      $headers = 'From: email@domainname.com' . "\r\n" .
          'Reply-To: email@domainname.com' . "\r\n" .
          'Content-Type: text/html' . "\r\n" .
          'X-Mailer: PHP/' . phpversion();
  
      mail($to, $subject, $message, $headers);
  }   ?&gt;
  </code></pre>