Hello guys.
I have page main.html which is a client application for a specific server. The main.php is an window with three frames.
main.html
<frameset frameborder=no border=0>
<frame name='top1' src='top1.php' frameborder=no scrolling=no>
<frame name='top2' src='top2.php' frameborder=no scrolling=no>
<frame name='firstpage' src='firstpage.php' frameborder=no scrolling=auto>
</frameset>
firstpage.php
<?php
....
....
require_once("connection.php");
// connection.php is a class which opens a socket and establishes with another server.
set_time_limit(0);
ignore_user_abort();
function parse($line) {
//parses $line returns $a which contains some data etc
....
return $a;
}
$connect= new Connection();
.....
$line=$connect->socket_read(1028);
.....
while ($i<200) {
$GLOBALS[userdata][$i]=parse($line);
.......
}
?>
firstpage.php is a large script and i have trimmed majority of firstpage.php for reasons of legibility. connect.php and firstpage.php are working exactly the way i desire.
I need to have the $GLOBALS[userdata] available in top1.php and top2 for further processing. Is there anyway i can access the $GLOBALS[userdata] WITHOUT instantiating connect.php again? (The data processing that i wish to do in top1.php and top2.php CANNOT be done in firstpage.php for reasons i cannot discuss here.) I cannot reinstantiate connect.php as the data from the server already to firstpage.php will not be resent by my server.
I have realized that since firstpage.php runs infintely $GLOBALS is not getting written. Tried session_write_close immediately after $GLOBALS[userdata][$i]=parse($line); in the while loop. But that didnot help.
I have also found that the SESSIONID in top1.php, top2.php and firstpage.php is the same.
Can anyone point me in the right direction?
Thanks!!