我在我的项目中的这个地址
localhost/v1.2/login_pane/login_pane-personnelselect/profile/profile.php
我想重定向到此页[localhost/v1.2/login_pane/loginmain.html
并且页面始终将我重定向到localhost/v1.2/login_pane/login_pane-personnelselect/login_pane/index.html
我在我的logout.php
中有这个PHP代码,但它没有工作
<?php
session_start();
if(session_destroy())
{
header("Location: ../../loginmain.html");
}
?>
我将如何制作它?
答案 0 :(得分:0)
尝试这样
<?php
session_start();
if(session_destroy())
{
header("Location: ../../loginmain.html");
}
?>
答案 1 :(得分:0)
试试这个
<?php
session_start();
session_unset();
header("Location: ../../loginmain.html");
?>
答案 2 :(得分:0)
请尝试使用以下代码:
session_start();
unset($_SESSION["nome"]); // where $_SESSION["nome"] is your own variable. if you do not have one use only this as follow **session_unset();**
header("Location: ../../loginmain.html");