title: PHP, HTTP_REFERER not working on iframe?
body: <p>Okay, here is my situation.</p>
  
  <p>I have a page, index.php, which is the mainsite (flash site)</p>
  
  <p>I have another page called iframe.php which contain iframe of index.php</p>
  
  <p>Another page, test.php. Inside have 2 links, 1st link is directly to index.php, another link is to iframe.php</p>
  
  <p>I tested:</p>
  
  <ul>
  <li><p>I click the 1st link, when i trace/echo the HTTP_REFERER, it displays "test.php", but</p></li>
  <li><p>I click on 2nd link, when i trace/echo the HTTP_REFERER, it displays "iframe.php".</p></li>
  </ul>
  
  <p>Why it display "iframe.php"? Is HTTP_REFERER does not work on iframe?? </p>
  
  <p>Is there anyway to get the "test.php" when i click on second link?</p>
  
  <p>Source code for :index.php</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt; // Some headers information
  &lt;script type="text/javascript" src="js/swfobject.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript"&gt;
  var flashvars = {};
      &lt;?php
  if(!empty($_SERVER['HTTP_REFERER'])){
  ?&gt;
      flashvars.link       =  '&lt;?php echo $_SERVER['HTTP_REFERER']; ?&gt;';
  &lt;?php
  }
  ?&gt;
  var params = {};
  var attributes = {};
  swfobject.embedSWF("main.swf, "content", "100%", "100%", "9", "expressInstall.swf", flashvars, params, attributes);
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;div id="content"&gt;
      &lt;a href="http://www.adobe.com/go/getflashplayer"&gt;
              &lt;img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /&gt;
          &lt;/a&gt;
      &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Source code for iframe.php</p>
  
  <pre><code>&lt;html&gt; headers tag
  ...
  &lt;body&gt;
  &lt;center&gt;&lt;iframe src="index.php" mce_src="index.php" frameborder="0" height="500" scrolling="no" width="500"&gt;&lt;/iframe&gt;&lt;/center&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Source code for test.php:</p>
  
  <pre><code>....
  &lt;a href="iframe.php" target="_blank"&gt;This is Iframe&lt;/a&gt; &lt;br&gt;&lt;br&gt;
  ....
  &lt;a href="index.php" target="_blank"&gt;This is normal link&lt;/a&gt; &lt;br&gt;&lt;br&gt;
  </code></pre>