title: header (location: someurl.php) not working in online server
body: <p>the <code>header(location: agentverification.php)</code> does not work when uploaded to godaddy server while it works on localhost server. I've try to edit my codes but the result is still the same. if any of you could help me, I'd appreciate it and thanks in advance.</p>
  
  <p><strong>agentlogin.php</strong></p>
  
  <pre><code>&lt;form method = "post" action = "agentverification.php" &gt;
  
  &lt;table&gt;
  
  &lt;input type="text" name="ID" size=20 &gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;
  &lt;td&gt;Password &lt;font color=red&gt;*&lt;/font&gt;&lt;/td&gt; 
  
  &lt;td&gt;&lt;input type="password" name="pass" size=20&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
  
  &lt;/table&gt;
  &lt;input type = "hidden" name = "login"&gt;
  &lt;input type = "submit" name = "login" value = "submit" id="pop"&gt;
  </code></pre>
  
  <p><strong>agentverification.php</strong></p>
  
  <pre><code>&lt;?php
  
  session_start();
  
  
  $link = mysqli_connect('localhost', 'root', '','db5') or die(mysqli_error());
  
  if(isset($_POST['login']))
  
  {
  extract($_REQUEST);
  
  $id = $_POST['ID']; 
  
  $pass = $_POST['pass'];
  
  
  $query= "SELECT * FROM agentReg WHERE AgentID = '$id'";
  
  $record = mysqli_query ($link,$query);
  
  
                  $check=FALSE;
  
                  while($row=mysqli_fetch_array($record))
                  {
                      if($id === $row['AgentID']&amp;&amp; $pass === $row['password'] )
                      {
                          $check=TRUE;
                      }
                  }
  
  
                  if($check == TRUE)
                  {
                      $_SESSION['AgentID'] = $id;
                      $_SESSION['password'] = $pass;
                      header("Location: agentpage.php");
                  }
                  else 
                  { ?&gt; &lt;script&gt; 
                  alert ("Wrong combination of ID and Password. Please try again.");
                  &lt;/script&gt; &lt;?php
                      session_destroy();
                      header("location: agentlogin.php");
                  }
  
  }?&gt;
  
  &lt;script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.js"&gt;&lt;/script&gt;
  </code></pre>
  
  <p><strong>agentReg</strong> database structure</p>
  
  <pre><code>CREATE TABLE agentReg
  (AgentID varchar (100) primary key,
  password varchar (100));
  </code></pre>