我正在网站上工作。我的代码有一个问题。请帮助我。 这是我的代码。在此标头位置不起作用。它在我的测试服务器上工作,但不在另一台服务器上工作。
帮助。
<?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');
}
?>
答案 0 :(得分:0)
@ob_start(); 在session_start();
在config.php文件的开头写上两行