View Full Version : Refresh Frames

09-02-2007, 01:40 AM
I have a logout button in my top frame, when it's hit it runs:


#### log out by destroying the session! #####

header('Refresh: 0; url=music.php');


But I also want the bottom frame to be refreshed... Can this be done in php? Can I target the frame?

09-02-2007, 01:56 AM
Can't be done in PHP without echoing javascript

09-02-2007, 02:01 AM
Ahhhhh bummer so can I do it with my current file? So do I need to have another file which contains js?

09-02-2007, 02:35 AM
No, you can do it like:

echo '<script type="text/javascript">parent.bottomframe.location = "page.php";</script>';

I just don't know the correct javascript

09-02-2007, 02:51 AM
Wow that worked!!!! Now I tried to edit the signup file, becuase I need to refresh the top frame on signup... I added the top line to the authenticate.php, which refreshes the frame in the top... but the bottomFrame has the error below...

closeDatabase($rs, $dbConnection);
echo '<script type="text/javascript">parent.mainFrame.location = "music.php";</script>';

And the error:

Warning: Cannot modify header information - headers already sent by (output started at /home/html/authenticate.php:80) in /home/html/authenticate.php on line 81

09-02-2007, 02:57 AM
remove the header and just use javascript:

echo '<script type="text/javascript">parent.mainFrame.location = "music.php";window.location = "page.php";</script>';

09-02-2007, 03:05 AM
you cant change the header information after anything has been printed onto a page.(even if its just jsut a space/linebreak)


09-02-2007, 03:28 AM
Mwnciau dude perfect works flawlessy now thanks heaps!!!

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum