Solved

PHP: Get Iframe parent URL & referrer

Posted on 2009-05-13
1
3,425 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
ID: 24381047
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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

815 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

9 Experts available now in Live!

Get 1:1 Help Now