使用“注销”按钮注销的用户不会重定向到php文件而不是索引
因此,我试图注销我的用户并将其返回到主屏幕,但我只是被重定向到我的logout.php文件(白色屏幕)。这里的任何帮助都是代码: (logout.php文件)使用“注销”按钮注销的用户不会重定向到php文件而不是索引,php,html,Php,Html,因此,我试图注销我的用户并将其返回到主屏幕,但我只是被重定向到我的logout.php文件(白色屏幕)。这里的任何帮助都是代码: (logout.php文件) 按钮: <li class="nav-item"> <?php if(isset($_SESSION['user_id'])): ?> <a href="logout.php" class="nav-link
按钮:
<li class="nav-item">
<?php if(isset($_SESSION['user_id'])): ?>
<a href="logout.php" class="nav-link btn-success logout-btn">Logout</a>
<?php endif; ?>
</li>
尝试了一系列不同的事情,但都没有成功
我希望被重定向到index.php登录屏幕,因为位置头的格式不正确,所以浏览器不会跟随它。尝试:
header("Location: ../index.php");
@鬼:你打开错误报告了吗?检查PHP错误日志?添加输出以确认代码是否已执行?
header("Location: ../index.php");