注销脚本无法正常工作。 [英] logout script not working properly.
问题描述
我已经从admin部分注销登出页面,并提供了从admin部分注销的链接。每当我点击注销链接时,它都会重定向到admin部分的index.php ......但是我正在注意回去扔回浏览器的按钮....它发送给我最后一次访问的页面(意味着sessons没有正确到期)。我怎么能解决它...还有一件事是脚本在localhost上正常工作....当我将它上传到服务器上时出现问题。
注销代码如下....
[php]<?phpsession_start();
if($ _ SESSION [''user_id'']!=""&& $ _SESSION [ ''user_pwd'']!="")
{
$ _SESSION = array();
session_unset();
session_destroy();
?>
< script>
window.location.href =" index.php" ;;
< / script>
<?php
}
else
{?>
< script>
window.location.href =" index.php";
< / script>
<?php}?> [/ php]
请在正确的代码标签中附上任何代码。请参阅发布指南,了解如何执行此操作。 - 主持人
I have done a logout page for logout from admin section and provides a link to logout from admin section.Whenever i clicked on logout link it redirected to index.php of admin section......BUT when i am tring to go back threw back button of Browser....it send me last visted pages(means sessons not expire properly). How can i solve it... One more thing is that the script is working properly on localhost....problem occures when i uploaded it on server.
code of logout is following....
[php]<?phpsession_start();
if($_SESSION[''user_id'']!="" && $_SESSION[''user_pwd'']!="")
{
$_SESSION=array();
session_unset();
session_destroy();
?>
<script>
window.location.href="index.php";
</script>
<?php
}
else
{ ?>
<script>
window.location.href="index.php";
</script>
<?php } ?>[/php]
Please enclose any code within the proper code tags. See the Posting Guidelines on how to do that. - moderator
推荐答案
_SESSION [''user_id'']!="" &&&
_SESSION[''user_id'']!="" &&
_SESSION [''user_pwd'']!="")
{
_SESSION[''user_pwd'']!="")
{
>
_SESSION = array();
session_unset();
session_destroy();
?>
< script>
window.location.href =" index.php";
< / script>
< ;?php
}
else
{?>
< script>
window.location.href =" index.php";
< / script>
<?php}?> [/ php]
请在正确的代码标签中附上任何代码。请参阅发布指南,了解如何执行此操作。 - 主持人
_SESSION=array();
session_unset();
session_destroy();
?>
<script>
window.location.href="index.php";
</script>
<?php
}
else
{ ?>
<script>
window.location.href="index.php";
</script>
<?php } ?>[/php]
Please enclose any code within the proper code tags. See the Posting Guidelines on how to do that. - moderator
这篇关于注销脚本无法正常工作。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!