Hi

I have a main.php page which contains 2 frames: left.php and right.php

I set a logout function in left.php and redirect it to index.php

When I click the logout function, only left.php redirect to index.php.

header("Location: index.php Window-target: _parent"); not work

Any idea?

    Instead of performing the logout in left.php, perform the logout in index.php, based on some query string variable (e.g., index.php?logout=1). Then you can have a link in left.php to index.php that breaks out of the frames, and do not even need to use header().

      Not positive, but you might want to try it as two separate headers (in this order):

      header('Window-target: _parent');
      header('Location: index.php');
      

      Note: to be HTTP/1.1 compliant, you should actually use the full URL for the location header value.

      Ultimately, probably the best solution would be to get away from using HTML frames at all, as the ancillary problems they bring with them tend to offset their usefulness (page bookmarking and search engine access to name a couple).

        Both methods still cannot quit the frame and just left.php returned to index.php and right.php still be shown.

          Both methods still cannot quit the frame and just left.php returned to index.php and right.php still be shown.

          If you are using my suggestion, your link must break out of the frame, i.e., with target="_top".

            Write a Reply...