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 = 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 = url;


解决方法,在ie下,js跳转使用如下方法:
1     function gotoUrl(url){
2         var gotoLink = document.createElement('a');
3 
4         gotoLink .href = url;
5 
6         document.body.appendChild(gotoLink);
7 
8         gotoLink .click();
9     }

完美解决~~

原文地址:https://www.cnblogs.com/hongchenok/p/3884670.html