跟踪 HTTP 引荐来源网址
我有一个名为: refdes2.php
<script>
function go(){
window.frames[0].document.body.innerHTML='<form target="_parent" action="http://www.site.com/refdes3.php"></form>';
window.frames[0].document.forms[0].submit()
}
</script>
<iframe onload="window.setTimeout('go()', 99)" src="about:blank" style="visibility:hidden"></iframe>
然后另一个文件: refdes3.php
<?php
$reftest = $_SERVER['HTTP_REFERER'];
$browser = $_SERVER['HTTP_USER_AGENT'];
if ($reftest != "") { ?>
<script>
function go(){
window.frames[0].document.body.innerHTML='<form target="_parent" action="http://www.site.com"></form>';
window.frames[0].document.forms[0].submit()
}
</script>
<iframe onload="window.setTimeout('go()', 99)" src="about:blank" style="visibility:hidden"></iframe>
<?php
}
else {
?>
<script>
function go(){
window.frames[0].document.body.innerHTML='<form target="_parent" action="http://www.site.com/refdes4.php"></form>';
window.frames[0].document.forms[0].submit()
}
</script>
<iframe onload="window.setTimeout('go()', 99)" src="about:blank" style="visibility:hidden"></iframe>
<?php
}
?>
但仍然使用谷歌分析一些引荐流量泄漏到 refdes4.php 。
我想用一种不同的方式来跟踪http引荐来源网址(更准确,比如谷歌分析)可以做到这一点。
谢谢你!
if ($reftest != "") { ?>
表示仅当 http 引荐来源网址为空时,才会允许其通过。不然不行。
我希望它 100% 干净的空白 http 引用流量。 (有些浏览器不会将其留空)。 目前,70% 的流量是干净的。 30% 被泄露。
我正在寻找一种替代跟踪http引荐来源网址是否为空(更准确,如谷歌分析)的方法。
I have a file called: refdes2.php
<script>
function go(){
window.frames[0].document.body.innerHTML='<form target="_parent" action="http://www.site.com/refdes3.php"></form>';
window.frames[0].document.forms[0].submit()
}
</script>
<iframe onload="window.setTimeout('go()', 99)" src="about:blank" style="visibility:hidden"></iframe>
Then this other file: refdes3.php
<?php
$reftest = $_SERVER['HTTP_REFERER'];
$browser = $_SERVER['HTTP_USER_AGENT'];
if ($reftest != "") { ?>
<script>
function go(){
window.frames[0].document.body.innerHTML='<form target="_parent" action="http://www.site.com"></form>';
window.frames[0].document.forms[0].submit()
}
</script>
<iframe onload="window.setTimeout('go()', 99)" src="about:blank" style="visibility:hidden"></iframe>
<?php
}
else {
?>
<script>
function go(){
window.frames[0].document.body.innerHTML='<form target="_parent" action="http://www.site.com/refdes4.php"></form>';
window.frames[0].document.forms[0].submit()
}
</script>
<iframe onload="window.setTimeout('go()', 99)" src="about:blank" style="visibility:hidden"></iframe>
<?php
}
?>
But still with google analytics some referrer traffic leaks out to refdes4.php .
I guess a different way to track http referrer ( more accurate like google analytics) could do the thing.
Thank You!
if ($reftest != "") { ?>
Says that only if the http referrer is blank, it'll allow it to pass. Else nope.
I want it to go 100% clean blank http referrer traffic. ( some browsers don't blank it ).
Currently it's 70% clean traffic. 30% gets leaked.
An alternative to tracking if http referrer is blank (more accurate like google analytics) could be the thing i'm looking for.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
那么您试图通过使用表单、iframe 及其 src 属性和 javascript 来隐藏 HTTP-Referrer 数据?
好吧,那么你就依赖两者了。浏览器可能允许也可能不允许使用 iframe 的 src 属性设置和覆盖 http 引荐来源网址。您无法在所有情况下都 100% 确定隐藏引荐来源网址。
So you’re trying to hide the HTTP-Referrer data by using a form, an iframe and its src attribute and javascript?
Well, you are dependant on both then. Browsers may or may not allow setting and overwriting the http referrer with the src attribute of an iframe. You can not hide the referrer in all cases and for 100% sure at all.