doutang2017 2018-11-15 20:59
浏览 61

当我使用PHP更改页面时,我的URL没有更新,我该如何解决这个问题?

I have a login form, where you can login, but it doesnt work properly. I suspect its due to JQuery Mobile. When I logout, I go to the main login page, but my URL remains logout.php (a file that destroys the session, then uses header(location) to redirect user to login) and I cant login anymore, because my page is stuck. When I refresh this gets solved. But when I try to login, the URL remains login.php. When I refresh now, I get redirected back to login.php. A refresh doesnt work here. How can I fix this? Everything used to work, but now it doesnt.

<head>
<meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Hondensectie</title>
    <link rel="stylesheet" href="themes/themerollertest.min.css" />
    <link rel="stylesheet" href="themes/jquery.mobile.icons.min.css" />
    <link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.5/jquery.mobile.structure-1.4.5.min.css" />
    <script src="http://code.jquery.com/jquery-1.11.1.min.js"></script>
    <script src="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
    <link type="text/css" rel="stylesheet" href="css/style.css"/>
</head>

above you can see the head

 <?php   
 session_start();  
 session_destroy();  
 header("location: login.php"); 
 ?>  

above you see logout.php

  • 写回答

1条回答 默认 最新

  • dtxpz8785 2018-11-15 21:32
    关注
    <?php   
    session_start();  
    $des = session_destroy();  
    if($des) {
        header("Location: login.php"); 
    }
    ?>  
    
    评论

报告相同问题?

悬赏问题

  • ¥15 求帮我调试一下freefem代码
  • ¥15 R语言Rstudio突然无法启动
  • ¥15 关于#matlab#的问题:提取2个图像的变量作为另外一个图像像元的移动量,计算新的位置创建新的图像并提取第二个图像的变量到新的图像
  • ¥15 改算法,照着压缩包里边,参考其他代码封装的格式 写到main函数里
  • ¥15 用windows做服务的同志有吗
  • ¥60 求一个简单的网页(标签-安全|关键词-上传)
  • ¥35 lstm时间序列共享单车预测,loss值优化,参数优化算法
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图