IE 6 会提供 HTTP_REFERER 替代品吗?

发布于 2024-07-10 21:15:01 字数 286 浏览 5 评论 0原文

因此 IE(至少 6)不会帮助我处理我使用 PHP 请求的 $_SERVER["HTTP_REFERER"]

但我是 JavaScript 新手,刚刚在弹出窗口中使用了一个小例程来刷新调用弹出窗口的页面(即父页面)。 在 Firefox、Safari 等中工作得很好。

没有安全问题 - 我只想在窗口中加载的用户是调用弹出窗口(用于编辑)的页面的 URL。 (而不是弹出窗口的 URL)。

当我链接到弹出窗口时,是否必须发送 GET 中的 URL?

So IE (6, at least) won't help me with $_SERVER["HTTP_REFERER"] that I request with PHP.

But I'm new to JavaScript and have just used a little routine in a pop-up to refresh the page from which the popup was called (i.e. parent). Works beautifully in Firefox, Safari, etc.

There's NO security issue - I'd just like to the user loaded in the window is URL of page from which the pop-up (for editing) was called. (and not the pop-up's URL).

Am I forced to send the URL in a GET when I link to the pop-up?

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

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

发布评论

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

评论(3

与往事干杯 2024-07-17 21:15:02

IE 有一个解决方法可以在 JavaScript 转换上传递引用。

看这里:
http://webbugtrack。 blogspot.com/2008/11/bug-421-ie-fails-to-pass-http-referer.html

适用于 IE6、IE7 和 IE8

There is a workaround for IE to pass the referer on JavaScript transitions.

See here:
http://webbugtrack.blogspot.com/2008/11/bug-421-ie-fails-to-pass-http-referer.html

Works in IE6, IE7, and IE8

夜司空 2024-07-17 21:15:02

为了将来的参考,document.referrer 在 javascript 中也能正常工作。 但在这个例子中,你绝对应该使用 gnud 的方法,并考虑到 RoBorg 的评论。

For future reference, document.referrer works as well in javascript. But in this example, you should definitely use gnud's method, taking into cacount RoBorg's comment.

幻想少年梦 2024-07-17 21:15:01

您不能依赖任何发送 HTTP_REFERER 的浏览器。

要刷新父窗口,请执行以下操作:

window.opener.location.reload()

在其他情况下,使用 PHP 会话而不是依赖引用站点。

You can't rely on any browser sending the HTTP_REFERER.

To refresh a parent window, do:

window.opener.location.reload()

In other cases, use a PHP session instead of relying on the referrer.

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