HTTP Referrer和IE7和IE8 [英] HTTP Referrer and IE7 and IE8

查看:146
本文介绍了HTTP Referrer和IE7和IE8的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好我已尝试以下方法在MSIE / IE7和IE8中找到推荐人,但每次都返回空白;

Hi i've tried the following to find the referrer in MSIE / IE7 and IE8 but its returning blank each time;

PHP:

<?
echo $_SERVER['HTTP_REFERER'];
?>

JAVASCRIPT:

document.write('Thanks for visiting from ' + document.referrer);

有没有人知道问题是什么我正在使用另一个页面上的document.location来引用它域名,并与所有其他浏览器一起工作,减去MSIE。

Does any know what the issue could be I'm referering using document.location from a page on another domain and work fine with all other browsers minus MSIE.

任何帮助都会很棒!

推荐答案

HTTP Referer header < HTTP协议不要求/ a>:

The HTTP Referer header is not required by the HTTP Protocol :


  • 它仅作为信息发送

  • 浏览器可以或不可以发送(这可以解释为什么你用某些浏览器获取它,而不是用其他浏览器获取它)

  • 有些防火墙/安全软件可能会删除它,我想,在某些情况下(我已经看到,几年前,如果我没记错的话)

  • 用户可以轻松伪造

  • It is only sent as an information
  • The browser can, or cannot, send it (Which would explain why you're getting it with some browsers, and not getting it with some others)
  • Some firewall / security software could remove it, I suppose, in some situations (I've seen that, some years ago, if I remember correctly)
  • It can be forged easily by the user

这意味着你不能依赖<$ y的c $ c> Referer 我们的应用程序:你可以使用它来提供一些额外的功能,但你的应用程序必须工作,即使它不存在或不正确。

Which means that you cannot rely on the Referer for your application : you can use it to provide some additionnal functionnality, but your application must work even if it's not there, or not correct.

这篇关于HTTP Referrer和IE7和IE8的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆