break out of Frames

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
oz
Forum Newbie
Posts: 11
Joined: Sun May 26, 2002 7:15 am
Location: Michigan
Contact:

break out of Frames

Post 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
User avatar
EvilWalrus
Site Admin
Posts: 209
Joined: Thu Apr 18, 2002 3:21 pm
Location: Springmont, PA USA

Post by EvilWalrus »

javascript is client side... php is serverside... this kind of operation can only be done with JS
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post 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.
User avatar
oz
Forum Newbie
Posts: 11
Joined: Sun May 26, 2002 7:15 am
Location: Michigan
Contact:

Post 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
User avatar
James Pelow
Site Admin
Posts: 51
Joined: Sat Jun 01, 2002 5:28 am
Location: Killiney, Co. Dublin, Ireland
Contact:

Moo!!! I never know what to put here

Post 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
Post Reply