Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8

Thread: Refresh Frames

  1. #1
    Regular Coder
    Join Date
    Mar 2006
    Posts
    459
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Refresh Frames

    I have a logout button in my top frame, when it's hit it runs:

    PHP Code:
    <?php 
    session_start
    ();

    #### log out by destroying the session! #####
    session_destroy(); 

    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?

  • #2
    Regular Coder
    Join Date
    May 2006
    Location
    Wales
    Posts
    820
    Thanks
    1
    Thanked 82 Times in 79 Posts
    Can't be done in PHP without echoing javascript

  • Users who have thanked Mwnciau for this post:

    tomyknoker (09-02-2007)

  • #3
    Regular Coder
    Join Date
    Mar 2006
    Posts
    459
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Ahhhhh bummer so can I do it with my current file? So do I need to have another file which contains js?

  • #4
    Regular Coder
    Join Date
    May 2006
    Location
    Wales
    Posts
    820
    Thanks
    1
    Thanked 82 Times in 79 Posts
    No, you can do it like:

    PHP Code:
    <?php
    echo '<script type="text/javascript">parent.bottomframe.location = "page.php";</script>';
    I just don't know the correct javascript

  • #5
    Regular Coder
    Join Date
    Mar 2006
    Posts
    459
    Thanks
    3
    Thanked 0 Times in 0 Posts
    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...

    PHP Code:
    closeDatabase($rs$dbConnection);
            echo 
    '<script type="text/javascript">parent.mainFrame.location = "music.php";</script>';
            
    header("location:home.php"); 
    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

  • #6
    Regular Coder
    Join Date
    May 2006
    Location
    Wales
    Posts
    820
    Thanks
    1
    Thanked 82 Times in 79 Posts
    remove the header and just use javascript:

    PHP Code:
    echo '<script type="text/javascript">parent.mainFrame.location = "music.php";window.location = "page.php";</script>'
    Last edited by Mwnciau; 09-02-2007 at 04:00 AM. Reason: ' instead of "

  • #7
    Regular Coder GO ILLINI's Avatar
    Join Date
    Jun 2005
    Location
    USA
    Posts
    634
    Thanks
    0
    Thanked 7 Times in 7 Posts
    you cant change the header information after anything has been printed onto a page.(even if its just jsut a space/linebreak)


    -Adam
    Why not thank me?

    http://adamsworld.name

  • #8
    Regular Coder
    Join Date
    Mar 2006
    Posts
    459
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Mwnciau dude perfect works flawlessy now thanks heaps!!!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •