首页  >  文章  >  后端开发  >  header("Location:index.php")页面跳转有关问题

header("Location:index.php")页面跳转有关问题

WBOY
WBOY原创
2016-06-13 13:32:52967浏览

header("Location:index.php")页面跳转问题
新手求教!!!急!
if($password == $row["password"])
 {
  $_SESSION["admin"]=1;
  $_SESSION["username"]=$username;
  header("Location:index.php");
  exit;
 }
执行这段代码后页面转为空页面,但重新从链接访问这个页面是它又是已经登录的界面(也就是它已经转到index.php了),这是为毛啊???

------解决方案--------------------
必须将浏览器关闭,重新打开后,session才会更新。标签页中,session实际没有销毁。

加个退出页面:

PHP code

//logout.php
session_start();
session_destroy();
header("Location:index.php");
<br><font color="#e78608">------解决方案--------------------</font><br>index界面没有东西? 你最好将表单页面和处理页面分开写。 <div class="clear">
                 
              
              
        
            </div>
声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn