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 请问有会的吗,用MATLAB做
  • ¥15 phython如何实现以下功能?查找同一用户名的消费金额合并—
  • ¥15 ARIMA模型时间序列预测用pathon解决
  • ¥15 孟德尔随机化怎样画共定位分析图
  • ¥18 模拟电路问题解答有偿速度
  • ¥15 CST仿真别人的模型结果仿真结果S参数完全不对
  • ¥15 误删注册表文件致win10无法开启
  • ¥15 请问在阿里云服务器中怎么利用数据库制作网站
  • ¥60 ESP32怎么烧录自启动程序,怎么查看客户esp32板子上程序及烧录地址
  • ¥50 html2canvas超出滚动条不显示