Page 1 of 1

break out of Frames

Posted: Sun Jun 02, 2002 3:16 pm
by oz
How would I use php to relace this java script?
to break a page out of a frames

<SCRIPT LANGUAGE="JavaScript">

<!-- Begin
if (window != top) top.location.href = location.href;
// End -->
</SCRIPT>
</CENTER>
<!-- Script

Been searching for it...

Oz

Posted: Sun Jun 02, 2002 3:28 pm
by EvilWalrus
javascript is client side... php is serverside... this kind of operation can only be done with JS

Posted: Sun Jun 02, 2002 3:36 pm
by volka
you may use

Code: Select all

<META HTTP-EQUIV="Window-target" CONTENT="_top">
within the html-page
or try

Code: Select all

Window-target: _top
sent with header()
both are (for heaven's sake) a bit unreliable. The second more than the first.
Since I hate it when pages pop up fullscreen unasked, I beg you to use it only where it helps users - not to nag them.

Posted: Sun Jun 02, 2002 3:43 pm
by oz
I just want to use it on my server, to help.
I have one page that uses frames ( cause I have flash across the top) and it looks weirld going back to the previous fpage that was a full page and now in a frame. lol

Using java script on it now, but was curious if php could do that.

Oz

Moo!!! I never know what to put here

Posted: Sun Jun 02, 2002 5:11 pm
by James Pelow
If it's from within you're own website then it's quite simple.

On the page that the link it coming from, that is the frame with the flash, add:

Code: Select all

<base target="_top">
if it's for every link of the page. Or if it's selective only for a few of the links add it to your a href

Code: Select all

<a href="noframepage.php" target="_top">
-James