Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

PHP: Get Iframe parent URL & referrer

Posted on 2009-05-13
1
Medium Priority
?
3,761 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
This article discusses how to create an extensible mechanism for linked drop downs.
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…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

926 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