Solved

PHP: Get Iframe parent URL & referrer

Posted on 2009-05-13
1
3,503 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Delete  php pages of a part of our site 8 44
Ajax and PHP 9 53
EditableGrid how to fetch rows from MySql in php 14 44
PHP $_POST vs asp request 4 19
Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
This article discusses how to create an extensible mechanism for linked drop downs.
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 look for a specific file type in a local or remote server directory using PHP.

680 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