PHP 中的标头位置不起作用


header location in php not working

我正在一个网站上工作。我的代码有一个问题。请帮助我。这是我的代码。在此标头位置不起作用。它在我的测试服务器上工作,但在另一台服务器上不起作用。

请帮忙。

    <?php
    include("../config/config.php");
    include("../classes/db.class.php");
    include("../classes/functions.php");
    extract($_POST);
    $data=userLogin($vUsername,$vPassword);
    if($data!="")
    {
        if($data['eStatus']=='Inactive')
        {
            $_SESSION['error']='Your account is pending for approval.';
            header('Location:../login.php');
            exit;
        }
        else
        {
            foreach ($data as $key => $value) 
            {
                $_SESSION['userData'][$key]=$value;
            }
            deleteUnpaidOrder($_SESSION['userData']['iUserID']);
            clearCart($_SESSION['userData']['iUserID']);
            $_SESSION['success']='welcome '.$data['vFname'].' '.$data['vLname'].'!';
            if($data['iOrganizationTypeID']==3 || $data['iOrganizationTypeID']==2 || $data['iOrganizationTypeID']==5)
                header('Location:../location.php'); 
            if($data['iOrganizationTypeID']==1)
                header('Location:../exclusiveOpportunityForShopOwners.php');    
            if($data['iOrganizationTypeID']==4)
                header('Location:../manageInStoreAdvertising.php'); 
        }
    }
    else
    {
        $_SESSION['error']='Username or Password is wrong please try agian.';
        header('Location:../login.php');
    }
?>

@ob_start();session_start();

在配置文件开头写两行.php