douwa1304 2016-10-24 06:27
浏览 53
已采纳

服务器拾取旧文件

I'm still inexperienced as a web developer so I have exhausted my knowledge on my current problem.

I recently made changes to files on my one website and uploaded them via FTP to the server. When I go to the website it's still executing the old code.

I cleared all my cache and tried on different devices. Even after changing the file names for example "logout.php" to "logout_code.php" as well as link references to those names when I click on the logout button it still goes to "logout.php".

Can anybody shed some light?

  • 写回答

1条回答 默认 最新

  • download12749 2016-10-24 06:32
    关注

    Try setting a no-cache header on the page that redirects to the logout page.

            header('Expires: Sun, 01 Jan 2014 00:00:00 GMT');
            header('Cache-Control: no-store, no-cache, must-revalidate');
            header('Cache-Control: post-check=0, pre-check=0', FALSE);
            header('Pragma: no-cache'); 
    

    The above snippet goes at the top of the page before any other output is sent. (within a <?php ?> tag of course)

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 孟德尔随机化结果不一致
  • ¥15 在使用pyecharts时出现问题
  • ¥15 深度学习残差模块模型
  • ¥50 怎么判断同步时序逻辑电路和异步时序逻辑电路
  • ¥15 差动电流二次谐波的含量Matlab计算
  • ¥15 Can/caned 总线错误问题,错误显示控制器要发1,结果总线检测到0
  • ¥15 C#如何调用串口数据
  • ¥15 MATLAB与单片机串口通信
  • ¥15 L76k模块的GPS的使用
  • ¥15 请帮我看一看数电项目如何设计