Php one.com上的标题未执行且未给出错误
我正在为我的网站创建一个登录系统,当用户登录时,我使用标题调用将他们重定向到另一个页面,标题调用没有执行,我没有收到任何错误,尽管我打开了one.com错误报告 登录验证Php one.com上的标题未执行且未给出错误,php,Php,我正在为我的网站创建一个登录系统,当用户登录时,我使用标题调用将他们重定向到另一个页面,标题调用没有执行,我没有收到任何错误,尽管我打开了one.com错误报告 登录验证 if (isset($_POST['login'])&& $_POST['login'] !== "") { $log = $login->check_login($username); if ($log) { // Registration Success
if (isset($_POST['login'])&& $_POST['login'] !== "") {
$log = $login->check_login($username);
if ($log) {
// Registration Success
header("Location: http://joshpercival.co.uk/webapp/indx.php");
} else {
// Registration Failed
$password_error='Wrong username or password';
}
}
登录类
public function check_login($username) {
$sql2="SELECT user_id FROM users WHERE username='$username'";
//checking if the username is available in the table
$check = Database::getInstance()->getConnection()->query($sql2);
$count_row = $check->num_rows;
if ($count_row == 1) {
// this login var will use for the session thing
$_SESSION['user_id'] = $user_data['user_id'];
return true;
}
else{
return false;
}
}
首先标记您正在使用的框架。我没有使用框架我已经创建了函数您是否检查了
check\u login()
返回的内容?check login返回我回显的消息,没有标头调用。标头仅在标头调用之前不输出时才有效。看看这个。