header函数在php中不起作用

header函数在php中不起作用,php,mysql,session,Php,Mysql,Session,为什么标题函数在这里不起作用? 它在本地主机上成功运行 <?php session_start(); if(isset($_POST['submit'])){ require_once('models/config.php'); require_once('models/mysql.class.php'); $username=$_POST['username']; $password=$_POST['password'];

为什么标题函数在这里不起作用? 它在本地主机上成功运行

<?php
    session_start();
    if(isset($_POST['submit'])){
        require_once('models/config.php');  require_once('models/mysql.class.php');
        $username=$_POST['username'];
        $password=$_POST['password'];       
        $obj_Pharmacies=new mysql();     
        $sql_query="SELECT * FROM `sellers_accounts` WHERE`user_name`='$username' AND `password`='$password'";
        $obj_Pharmacies->Execute($sql_query);
        if($obj_Pharmacies->Execute($sql_query)){

            $Pharmacies=$obj_Pharmacies->GetRows();         
            $cookie_seller_name=$Pharmacies[0]['name'];         
            $cookie_seller_user_name=$Pharmacies[0]['user_name'];
            $Pharmacies_number=count($Pharmacies);
            if($Pharmacies_number>=1){
                //$_SESSION['sellerName']=$cookie_seller_name;
                setcookie('sellerName', $cookie_seller_name, time() + (86400 * 30), "/");
                //$_SESSION['sellerUsername']=$cookie_seller_user_name;
                //$_SESSION['sellerName'];
                header("location:plans.php");
          }     
        }


    } 
?>


看看这篇文章启用错误报告。很可能是出现了警告(
标题已发送…
),而您就是看不到它。它在本地主机和我的主机上成功工作,尽管当我在客户端主机上上载代码时,它不起作用。我如何启用错误报告?
$base_url =  "http://" . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']; 
   $redirect_url = $base_url."plans.php";
   header("location:$redirect_url");