Solved

PHP: Get Iframe parent URL & referrer

Posted on 2009-05-13
1
3,367 Views
Last Modified: 2012-06-21
Using PHP, I'd like to get the domain and referrer of the top level document.  I am running this PHP from inside an iframe on the page.  I have code to get the primary URL or referrer.  However, I can't seem to figure out how to get the parent of the iframe's info.
<?php

  extract(parse_url($_SERVER['HTTP_REFERER']));

  $referer = $scheme .'://'. str_replace('www.', null, $host);

?>

Open in new window

0
Comment
Question by:Kokoglen
1 Comment
 
LVL 4

Accepted Solution

by:
Kokoglen earned 0 total points
Comment Utility
I think I am not going to be able to do it.  Cross-site scripting won't let me access a different domain via JS and PHP doesn't know that stuff in that context.

I have an alternative route.  Closing question.
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
These days socially coordinated efforts have turned into a critical requirement for enterprises.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now