好的,這是我的情況。PHP,HTTP_REFERER無法在iframe上工作?
我有一個頁面,index.php文件,這是mainsite(Flash網站)
我呼籲其他頁面iframe.php包含的index.php
另一個頁面的iframe中,test.php的。裏面有2個環節,第一個環節是直接的index.php,另一個環節是iframe.php
我測試:
我點擊鏈接1,當我跟蹤/回聲HTTP_REFERER,它顯示「test.php」,但
我點擊第二個鏈接,當我跟蹤/回顯HTTP_REFERER時,它顯示「iframe.php」。
爲什麼顯示「iframe.php」? HTTP_REFERER不能在iframe上工作?
反正有沒有得到「test.php」,當我點擊第二個鏈接?
的源代碼爲:爲的index.php test.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>
的源代碼:
....
<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>
請發佈'index.php','test.php'和'iframe.php'的源代碼,以便我們可以嘗試重現您的問題。 – Asaph 2009-12-18 04:10:58
roger那。給我5分鐘 – mysqllearner 2009-12-18 04:11:35