为什么 PHP 应用程序的“后退”按钮在 Internet Explorer 中无法正常工作,但在其他所有浏览器中却可以正常工作?

发布于 2024-09-27 08:16:23 字数 342 浏览 2 评论 0原文

我有一个 PHP 应用程序,它可以在除 Internet Explorer 之外的所有浏览器中正常运行。

该应用程序根据 MySQL 数据生成报告。每个报告的某些字段都是可单击的,并且会在使用 PHP header() 调用 POST 后将用户重定向到另一个页面/报告。

在 Safari、Firefox、Opera 等中,当用户单击“后退”按钮时,他们将返回到上一页/报告。在 Internet Explorer 中,此行为被破坏,我收到“网页已过期”错误。

我并不担心在 IE 中使用“后退”按钮时会提供过时的数据。

我可以在 IE 中调整设置以允许这种行为,或者我可以使用 HTML/PHP 指令吗?

I have a PHP application that works well in every browser except Internet Explorer.

The application generates reports based on MySQL data. Certain fields of each report are clickable and will redirect the user to another page/report after POST using the PHP header() call.

In Safari, Firefox, Opera, etc. when the user clicks the Back button they are taken back to the previous page/report. In Internet Explorer this behavior is broken and I get a "Webpage is expired" error.

I'm not worried about serving up stale data when using the Back button in IE.

Is there a setting I can tweak in IE to allow this behavior, or an HTML/PHP directive I can use?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

混吃等死 2024-10-04 08:16:23

没有。 Firefox、Chrome 等在这里实现了一个特定的功能,即浏览器历史记录中的最后一页实际上并不重要。 IE 显然没有该功能,并且不知道可能存在这样的功能,因此无法尝试让它拥有该功能。 (不过,较新的版本可能会实现这种行为。不确定。)

由于它实际上不是关键任务,看起来那些使用旧版浏览器的人只需要处理较少的体验。对不起!

Nope. Firefox, Chrome, etc. here implement a specific feature that notes that the last page in the browser history doesn't really count. IE apparently doesn't have that feature and is unaware that such a feature could possibly exist, so there is no way to try to get it to have it. (Newer versions may implement such behavior, though. Unsure.)

Since it's really not mission-critical, looks like those who use older browsers will just have to deal with a lesser experience. Sorry!

阳光①夏 2024-10-04 08:16:23

试试这个:


Try this:

<?php
header('Cache-Control: max-age=900');
?>
<html>

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文