title: PHP header redirection not working as expected
body: <p>I have the following issue. I collect some user input and then write it to a text file using PHP. After this is done I want to redirect to another web page - here www.google.com. I am having difficulty.</p>
  
  <pre><code>$myFile = "testFile.txt";
  $fh = fopen($myFile, 'a');
  $IP = $_SERVER["REMOTE_ADDR"].',';
  $logdetails=  $IP.date("F j, Y, g:i a O T");
  $stringTimeout = $_POST['_delay'];
  $stringData1 = $_POST['userChoices'];
  $s = ',';
  $postData = $s.$stringTimeout.$s.$stringData1"\n";
  fwrite($fh,$logdetails.$postData);
  fclose($fh);
  
  header("Location: http://www.google.com");
  </code></pre>