title: PHP Header redirect not working
body: <pre><code>include('header.php');
  
  $name = $_POST['name'];
  $score = $_POST['score'];
  $dept = $_POST['dept'];
  
  $MyDB-&gt;prep("INSERT INTO demo (`id`,`name`,`score`,`dept`, `date`) VALUES ('','$name','$score','$dept','$date')");
  // Bind a value to our :id hook
  // Produces: SELECT * FROM demo_table WHERE id = '23'
  $MyDB-&gt;bind(':date', $date);
  // Run the query
  $MyDB-&gt;run();
  
  header('Location:index.php');
      exit;
  </code></pre>
  
  <p>The above code keeps giving me an issue with the redirect. The error is the following: </p>
  
  <blockquote>
    <p>Warning: Cannot modify header information - headers already sent by (output
        started at /Applications/MAMP/htdocs/testygubbins/OO/test/header.php:15) in
        /Applications/MAMP/htdocs/testygubbins/OO/test/form.php on line 16.</p>
  </blockquote>
  
  <p>I am totally flummoxed by this. Does anyone know what I should be doing to make it work?</p>
  
  <p>EDIT</p>
  
  <p>header.php code:</p>
  
  <pre><code>&lt;?php
  include('class.user.php');
  include('class.Connection.php');
  
  $date = date('Y-m-j');
  
  ?&gt;
  &lt;html&gt;
  &lt;head&gt;
      &lt;link rel=StyleSheet href="css/style.css" type="text/css" media=screen&gt;
      &lt;title&gt;Test&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;div id="page"&gt;
  </code></pre>