Method One: Interact with cookies.
There are altogether three files, respectively: index.htm,action.php,main.htm
Principle for the foreground page main.htm and background action.php through the page frame index.htm organized, the width of the action.php page is set to 0, so that does not affect the display. Action.php the information into a cookie, main.htm the interaction by reading the cookie. Control of the background CGI program can also be achieved in main.htm by re-reading the action.php.
Index.htm
Copy CodeThe code is as follows:
<title>Test</title>
<noframes>&lt;br&gt;&lt;body bgcolor= "#FFFFFF" &gt; &lt;BR&gt;&lt;p&gt; page frames are used, but not supported by your browser. &lt;/p&gt; &lt;BR&gt;&lt;/body&gt; &lt;BR&gt;</noframes>
action.php
Copy CodeThe code is as follows:
Srand (Double) microtime () *1000000);
$result =rand (0,100);
Setcookie ("Action", $result, Time () +900, "/");
?>
Main.htm
Copy CodeThe code is as follows:
<title>Test</title>
Re-reading Cookies
Method Two: Directly through the parent.*.* to realize the interaction.
There are altogether three files, respectively: Index.htm,action.php,main.htm, of which index.htm is the same as in front.
The principle is to pass information directly through Parent.rightFrame.test.current_cookie.value.
action.php
Copy CodeThe code is as follows:
Srand (Double) microtime () *1000000);
$result =rand (0,100);
?>
Main.htm
Copy CodeThe code is as follows:
<title>Test</title>
Re-reading Cookies
http://www.bkjia.com/PHPjc/320746.html www.bkjia.com true http://www.bkjia.com/PHPjc/320746.html techarticle method One: Interact with cookies. Total is three files, respectively: index.htm,action.php,main.htm principle for the front page main.htm and backstage action.php through the page frame index.htm organization ...