可能重复:
PHP 已发送的标头
if ($_SERVER['REQUEST_METHOD'] == 'POST')
{
include 'verify.php';
$verify = new Verify();
$vali = $verify->VerifyUserLogin($_POST['UserEmail'], $_POST['Password']);
if($_SESSION['umUser'] == true)
{
header("Location: ../index.php");
}
else
{
$errorLogin = $_SESSION['loginForm'];
}
}
function VerifyUserLogin($userEmail, $password)
{
$this->connect();
$pass = md5($password);
$result = mysql_query("SELECT * FROM umuser where umUserIsAdmin = 1 and umUserEmail = '".mysql_real_escape_string($userEmail)."' and umUserPassword = '".mysql_real_escape_string($pass)."'");
if (mysql_num_rows($result) > 0)
{
while($row = mysql_fetch_array($result))
{
$_SESSION['umAnanymousGid'] = $row['umUserGID'];
$_SESSION['umUserName'] = $row['umUserName'];
$_SESSION['umUserEmail'] = $row['umUserEmail'];
$_SESSION['umUserId'] = $row['umUserID'];
$_SESSION['umUser'] = true;
}
//echo $_SESSION['umUser'];
//header('Location:../');
}
问题是它没有重定向到位置并生成警告警告:无法修改标头信息 - 标头已发送(输出开始于 ....)
请帮助
谢谢