我的使用:
window.location.replace("calendar.php");
我的PHP会话变量似乎根本不起作用。当我使用此调用时,我无法使用后退按钮和我的代码:
<?php
session_start();
if($_SESSION['loggedin'] != TRUE) {
header("Location: index.php");
}
?>
有谁知道为什么会这样?感谢。
答案 0 :(得分:2)
我认为你想要window.location.href = "calendar.php";
。这应该依赖于你的会话变量,以及不破坏后退按钮。
答案 1 :(得分:0)
这就是你有的原因:
但也
- 的 window.location.assign( “calendar.php”); 强>
第一个可能会清除会话,而第二个会保留会话。