php - PHP header(Location:...) not working
问题描述
Working on a sign up/log in form and for some reason header() redirect doesn't seem to be working.
if (password_verify($_POST['password'], $row['password'])){
header("Location: account.php");
if ($_POST['stayLoggedIn'] == 1){
setcookie("id", $row["id"], time() + 60*60*24*365);
}
}
I have checked that the code works as intended by swapping the header() with an echo and print_r to check that the fields were working and they return the expected information.
解决方案
推荐阅读
- javascript - 如何读取firestore上所有用户的所有嵌套集合?
- scala - 即使 Future 完成,Scala App 也不会退出
- apache - Apache 客户端身份验证使用来自三级证书链的相同两级的客户端和服务器证书
- sql - 计算一个单元格中的值
- jwt - 如何在不同设备上正确使用刷新令牌?
- spring-boot - 即使在更新 databasechangeloglock 后,Google Kubernetes Engine (GKE) pod 也无法释放 liquibase 锁
- javafx - 将标签 textProperty 绑定到另一个最终 ObjectProperty 持有的对象属性
- php - So how can we protect our PHP application scripts when installing locally for a client?
- log4cplus - I used log4cplus in two DLLs (a.dll and b.dll) of an exe file
- r - 使用dada2时R在conda环境中崩溃