header php 中的位置无法正常工作

header location in php not working

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

请帮忙。

    <?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();

在 config.php 文件的开头写上两行