How do I pass a value from an external page inside a frame?

I have files inside a page, this page named (mainframe.php) is a frameset containing two subframe files (file 1: topframe.php, file 2 bottom frame.php) and I need to pass the value from the outer page ( file: extarnalpage.php) inside frmams (top and bottom frames). but i cant do it ... and the pages will be as follows:

  • mainframe.php

..............................................

  • topframe.php

topframe content of the top of the screen

? >

.................................................. .....

  • bottomframe.php

bottomframe content of the bottom frame

..................................................

  • externalpage.php

bottomframe content of the bottom frame

        

.................................................. ......

my qus is how to get the text value from the outer .php to topframe.php and bottomframe.php. thank

+1


source to share


1 answer


What comes to mind are sessions.

Sessions are stored on the server, and it goes something like this:

to set variables in session:

<?php
session_start();

$_SESSION['some_variable_name_1']='some_variable_value_1';
$_SESSION['some_variable_name_2']='some_variable_value_2';
...
$_SESSION['some_variable_name_n']='some_variable_value_n';
?>

      



to retrieve variables from a session on another page:

<?php
session_start();

$some_variable_value_1 = $_SESSION['some_variable_name_1'];
$some_variable_value_2 = $_SESSION['some_variable_name_2'];
...
$some_variable_value_n = $_SESSION['some_variable_name_n'];
?>

      

more in sessions at http://www.php.net/session

But I really encourage you to leave frames and tables and use css to position the elements - it's much easier and you will end up with more readable html.

+1


source







All Articles