-1
任何人都可以告訴我什麼是我的代碼錯誤。 我試圖在用戶名密碼驗證後重定向。 條件工作正常。但重定向不起作用。PHP登錄後重定向
這裏是我的代碼
if(password_verify($password , $row['password']) && $count == 1)
{
if($row['status'] == 'active')
{
if ($row['designation'] == 'employee')
{
$_SESSION['CorpSession'] = $row['id'];
header("Location: ../corporate/index.php");
exit;
}
elseif($row['designation'] == 'admin')
{
$_SESSION['CorpSession'] = $row['id'];
header("Location: ../corporate/admin.php");
exit;
}
}
elseif($row['status'] == 'waiting')
{
$ErrMsg = "<div id='alert' class='alert alert-info'>Profile Approval pending !</div>";
}
else
{
$ErrMsg = "<div id='alert' class='alert alert-info'>Some Error Happened !</div>";
}
}
else
{
$ErrMsg = "<div id='alert' class='alert alert-danger'>Invalid Username or Password !</div>";
}
_But重定向沒有發生.._ _not happens_對你有什麼意義? –
激活錯誤報告和/或檢查錯誤日誌。最有可能的:[如何解決]已經發送的頭文件「PHP中的錯誤」(https://stackoverflow.com/q/8028957/476) – deceze
請添加更多信息,例如你有什麼嘗試和什麼是你得到的錯誤 –