The following code is not working even after having inserted ob_start(), and ob_flush();
I keep getting the PHP headers already sent error
<?php 
ob_start();
include("/home/www/pheincl/config.php");
include("/home/www/pheincl/common_functions.php");
$num = $_SERVER['HTTP_X_UP_CALLING_LINE_ID'];
if($num == null)
{
  $num = $_SERVER['HTTP_X_MSISDN'];
  if($num == null)
  {
    $num = $_GET["msisdn"];
  }
}
if(strlen($num) > 3)   
{
  $sql="select count(*) from members where msisdn='$num'";
  $r=fetch($sql);
  if($r[0] > 0)
  {
    $r1=fetch("select pin from members where msisdn='$num'");
    if(strlen($r1[pin]) > 2)
    {
      header("Location:http://location1.com?msisdn=$num&pin=$r1[pin]");
    }
  }
  else
  {
    header("Location:http://location2.com&msisdn=$num");
  }   
}
else 
{
  header("Location:location3.com/phe/log.php");
}
ob_end_flush();
?>
UPDATE: After some further testing it looks like this problem is specific to my servier. Someone I know put this on their server and it worked fine
 
     
     
     
    