Home  >  Article  >  Backend Development  >  header("Location:index.php")页面跳转有关问题

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

WBOY
WBOYOriginal
2016-06-13 13:32:52967browse

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>
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn