Forum Moderators: coopster

Message Too Old, No Replies

Iframes auto redirecting to parent page

         

Creechur

12:04 am on Nov 21, 2003 (gmt 0)

10+ Year Member



I used this code:

function AddonSample() {
global $module_name;
include("header.php");

echo "<iframe src='http://www.somesite.com/chiligear' name='frame1' scrolling='auto' frameborder='no' align='center' height = '400px' width = '400px' ></iframe>";

include("footer.php");
}

but the Iframe auto redirects to the parent page. Anyone know why?

[edited by: jatar_k at 12:08 am (utc) on Nov. 21, 2003]
[edit reason] generalized url [/edit]

jatar_k

12:11 am on Nov 21, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld Creechur,

Is it not your site? It looks like it is done in their code. I tested it on one of my sites and it did the same thing.

this is in their code

<script language="javascript">
<!--
if (top.location!= location) top.location.href = location.href;
//-->
</script>

We call that a frame buster.

Creechur

12:36 am on Nov 21, 2003 (gmt 0)

10+ Year Member



Any way to get around that? I know its php-nuke and all, but anything you can think of would be appreciated.

jatar_k

2:22 am on Nov 21, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



no way around it, I dont think, since it is on their end. I use a similar one on my site and I don't know of anyone getting around it.

NickCoons

4:40 am on Nov 21, 2003 (gmt 0)

10+ Year Member



Creechur,

<Any way to get around that?>

You'd have to set the src of your iframe to a script on your system locally. This script would have to open the target page using fopen(), read in the contents, check for the frame buster, and echo everything to the browser except the frame buster.