首页 > 代码库 > ie下,php HTTP_REFERER获取失败的整理
ie下,php HTTP_REFERER获取失败的整理
HTTP_REFERER有效的情况
1、以iframe 形式调用地址
2、以window.open调用,打开新页面window.open(url);
3、使用window.location.replace在Firefox 和Chrome下可以获取HTTP_REFERER
window.location.replace(url);
4、使用window.location.href在Firefox 和Chrome下可以获取HTTP_REFERER
window.location.href = http://www.mamicode.com/url;
5、使用A标签跳转可以获取HTTP_REFERER
HTTP_REFERER无效的情况
1、使用函数 file_get_contents或file等函数调用URL地址,这个地址所在的文件无法获取HTTP_REFERER
2、使用window.location.replace在IE6、IE7、IE8下无法获取HTTP_REFERER
window.location.replace(url);
3、使用window.location.href在IE6、IE7、IE8下无法获取HTTP_REFERER
window.location.href = http://www.mamicode.com/url;
解决方法,在ie下,js跳转使用如下方法:
1 function gotoUrl(url){2 var gotoLink = document.createElement(‘a‘);3 4 gotoLink .href =http://www.mamicode.com/ url;5 6 document.body.appendChild(gotoLink);7 8 gotoLink .click();9 }
完美解决~~
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。