好的,这是我的情况。
我有一个页面 index.php,它是主站点(flash 站点)
我有另一个名为 iframe.php 的页面,其中包含 index.php 的 iframe
另一个页面,test.php。里面有2个链接,第一个链接直接指向index.php,另一个链接指向iframe.php
我测试过:
我单击第一个链接,当我跟踪/回显 HTTP_REFERER 时,它显示“test.php”,但是
我单击第二个链接,当我跟踪/回显 HTTP_REFERER 时,它显示“iframe.php”。
为什么它显示“iframe.php”?HTTP_REFERER 在 iframe 上不起作用吗?
当我点击第二个链接时,是否有办法获得“test.php”?
:index.php 的源代码
<html>
<head> // Some headers information
<script type="text/javascript" src="js/swfobject.js"></script>
<script type="text/javascript">
var flashvars = {};
<?php
if(!empty($_SERVER['HTTP_REFERER'])){
?>
flashvars.link = '<?php echo $_SERVER['HTTP_REFERER']; ?>';
<?php
}
?>
var params = {};
var attributes = {};
swfobject.embedSWF("main.swf, "content", "100%", "100%", "9", "expressInstall.swf", flashvars, params, attributes);
</script>
</head>
<body>
<div id="content">
<a href="http://www.adobe.com/go/getflashplayer">
<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" />
</a>
</div>
</body>
</html>
iframe.php 的源代码
<html> headers tag
...
<body>
<center><iframe src="index.php" mce_src="index.php" frameborder="0" height="500" scrolling="no" width="500"></iframe></center>
</body>
</html>
test.php 的源代码:
....
<a href="iframe.php" target="_blank">This is Iframe</a> <br><br>
....
<a href="index.php" target="_blank">This is normal link</a> <br><br>