Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

PHP: Get Iframe parent URL & referrer

Posted on 2009-05-13
1
Medium Priority
?
3,687 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

These days socially coordinated efforts have turned into a critical requirement for enterprises.
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
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…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

722 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