Redirect inside a Frame

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
AliasBDI
Forum Contributor
Posts: 286
Joined: Fri Nov 15, 2002 10:35 am
Location: Spring, TX, USA

Redirect inside a Frame

Post by AliasBDI »

I have this code

header('Location: index.php')

which redirects putting the "index.php" page in the "_parent" window. I need it to go in the "content" frame. How would that work?
Leash
Forum Newbie
Posts: 5
Joined: Thu Nov 06, 2003 7:34 am
Location: Sweden

Post by Leash »

Hi,
I don't think this can be solved by using only php.
I usually use some javascript to solve it. Something like this:
if($doreload){
?>
<script language="JavaScript">
parent.frames['frmTop'].location.reload();
</script>
<?
}
?>

Hope it helps!
Cheers!
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

Not sure what this has to do with Databases so I've moved it to the PHP - Code forum.

Mac
d3ad1ysp0rk
Forum Donator
Posts: 1661
Joined: Mon Oct 20, 2003 8:31 pm
Location: Maine, USA

Post by d3ad1ysp0rk »

meta refresh?
AliasBDI
Forum Contributor
Posts: 286
Joined: Fri Nov 15, 2002 10:35 am
Location: Spring, TX, USA

Any more ideas??

Post by AliasBDI »

MetaRefresh won't work.

And I don't know anything about javaScript.

Anymore ideas... Surely this can be done in PHP.
hedge
Forum Contributor
Posts: 234
Joined: Fri Aug 30, 2002 10:19 am
Location: Calgary, AB, Canada

Post by hedge »

No it can't, it's not a php issue. The RFC does not supply a header to target the frame.

Is this action initiated by a link, if so just put the target of _parent on that link. Otherways either a meta-refresh or javascript is the only way.
Post Reply