title: PHP: header not working
body: <p>Ive read pretty much alot of post about this but seems like its not helping me. </p>
  
  <p>I have been working an a testing local server and everything has been working swimmingly, but when I uploaded it to the web the php is suddenlly not working properly. I am connected to the db and all. the main issues I have is with the header (as far as I know).</p>
  
  <p>I have been shaving bits of code and simplifying it to narrow down the problem and came to the conclusion that it was the header:</p>
  
  <pre><code>&lt;?php
  require 'admin/Connections/Connections.php';
  session_destroy();
  if(isset($_POST['Login'])){
  
  $UN = $_POST['Username'];
  $PW = $_POST['password1'];
  
  $result = mysql_query("select * from admin where Username='$UN'");
  
  $row = mysql_fetch_array($result);
  echo $row['Password'];
  echo $_POST['password1'];
  
  if($PW == $row['Password']){
  
  header('Location: admin/home.php');
  
  }else{
  
      $_SESSION["LoginFail"] = "Yes";
  }
  }
  ?&gt;
  </code></pre>
  
  <p>the echo spits out both $post and $row as the same value so I know it should execute the header, but it just refreshes the page with the added echos.</p>
  
  <p>I tried replacing the url with something like <a href="http://www.google.com/" rel="nofollow">http://www.google.com/</a>  but that takes me to a blank page with the echos. what am I missing? if it is something obvious you have permission to trash me as long as you give me an answer...</p>