D'accord, voici ma situation.PHP, HTTP_REFERER ne fonctionne pas sur iframe?
J'ai une page, index.php, qui est le mainsite (site flash)
J'ai une autre page appelée iframe.php qui contiennent iframe de index.php
Une autre page test.php . ont à l'intérieur 2 liens, 1er lien est directement index.php, un autre lien est iframe.php
Je l'ai testé:
je clique sur le 1er lien, quand je trace/écho le HTTP_REFERER, il affiche "test.php", mais
Je clique sur le 2ème lien, quand je trace/renvoie le HTTP_REFERER, il affiche "iframe.php".
Pourquoi afficher "iframe.php"? HTTP_REFERER ne fonctionne pas sur iframe ??
Est-il possible d'obtenir le "test.php" quand je clique sur le second lien?
code source pour: 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>
code source pour 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>
code source pour 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>
Veuillez poster le code source pour 'index.php',' test.php' et 'iframe.php' afin que nous puissions essayer de reproduire votre problème. – Asaph
roger cela. Donnez-moi 5 minutes – mysqllearner