i have a page with 3 frames (header, and 2 frames that take up all the space which show certain info) and when my session expires,
i want the 2 frames below the header to change to their original values (static html pages). my pages call a function verify_session, i got this from the php.net manual where someone put a submission on user authentication using sessions....

this function checks if the session is valid and if not has a header statement to redirect the user.

so the problem is when the session expires, only one frame goes back to the login screen. i need to let the other frame refresh too.

how can i do that?

    use the verify sessions code you are using, but try looking at some javascript change multiple frame codes

      how do you call javascript within php?

      do you have to use functions?
      or can you run the code directly?

      then how about this?

      <?php
      if (condition){
      //javascript for changing frames
      parent.frame1.location="http://somelocation1";
      parent.frame2.location="http://somelocation2";
      }

      im not sure how to do this coz of the quotes....

      is it ok to echo it??

      but how?

        not too good with javascript but it'd probably be something like this

        <? 
        if (condition){ 
        //javascript for changing frames 
        echo "<script language=\"javascript\">";
        echo "parent.frame1.location=\"http://somelocation1\""; 
        echo "parent.frame2.location=\"http://somelocation2\""; 
        echo "</script>";
        } 
        ?>
        

          i cant seem to get it to work.

          hmmm, what could be the problem?

            If you are trying to just load the main frameset back (called from index.html for example), then your link could just be something like:

            <a href="index.html" target="_top">Logout link</a>

            It would be something slightly different for an expired session obviously, but the principle is the same.

              thanx, but i already got a logout link like that.

              problem is with the javascript its like its being ignored.

                Write a Reply...