ProTeuS
25.02.2009, 23:34
Под ИЕ все работает как нужно. А под ФФ и Оперой пробрасывается реферер, а нужно чтобы был пустой как в ИЕ либо INDEX.PHP. Как это можно сделать?
///////////////////////////////////////////////////
// INDEX.PHP
///////////////////////////////////////////////////
<?
$r=rand(1000,9999);
?>
<i>r=<?=$r?></i>
<p>
<a onClick="t1('location.php?r=<?=$r?>');" href='javascript:void(0);'>document.location - iframe</a><br>
<p>
<iframe name=f></iframe>
<script>
function t1(url) {
window.frames.f.location = url;
}
</script>
///////////////////////////////////////////////////
// LOCATION.PHP
///////////////////////////////////////////////////
<?
$url = 'http://'.$_SERVER['HTTP_HOST'].dirname(dirname($_SERVER['REQUEST_URI'])).'/js/dst.php?'.$_SERVER['QUERY_STRING'];
?>
<body>
<script>
if (-1 == document.cookie.indexOf('<?=$_GET['r']?>')) {
document.cookie = '<?=$_GET['r']?>=';
top.location = '<?=$url?>';
}
else {
document.write("already clicked");
}
</script>
///////////////////////////////////////////////////
// DST.PHP
///////////////////////////////////////////////////
http ref: <?=$_SERVER['HTTP_REFERER']?>
<br>
<script>document.write('js ref: '+document.referrer)</script>
///////////////////////////////////////////////////
// INDEX.PHP
///////////////////////////////////////////////////
<?
$r=rand(1000,9999);
?>
<i>r=<?=$r?></i>
<p>
<a onClick="t1('location.php?r=<?=$r?>');" href='javascript:void(0);'>document.location - iframe</a><br>
<p>
<iframe name=f></iframe>
<script>
function t1(url) {
window.frames.f.location = url;
}
</script>
///////////////////////////////////////////////////
// LOCATION.PHP
///////////////////////////////////////////////////
<?
$url = 'http://'.$_SERVER['HTTP_HOST'].dirname(dirname($_SERVER['REQUEST_URI'])).'/js/dst.php?'.$_SERVER['QUERY_STRING'];
?>
<body>
<script>
if (-1 == document.cookie.indexOf('<?=$_GET['r']?>')) {
document.cookie = '<?=$_GET['r']?>=';
top.location = '<?=$url?>';
}
else {
document.write("already clicked");
}
</script>
///////////////////////////////////////////////////
// DST.PHP
///////////////////////////////////////////////////
http ref: <?=$_SERVER['HTTP_REFERER']?>
<br>
<script>document.write('js ref: '+document.referrer)</script>