How to maintain interaction between the front-end page and the background CGI page without refreshing a new page during the web page creation process remains a problem. Here we will introduce two methods. Method 1: use cookies for interaction.
There are three files in total: index.htm,action.php and main.htm
The original reason is that the main.htm and the background action. php are organized through the page framework index.htm and the page width of action. php is set to 0, which does not affect the display. Action.php adds the information to cookie, and main.htm reads cookies for interaction. In main.htm, you can also control the background CGI program by re-reading action. php.
Index.htm
The code is as follows:
Test
<BR> <body bgcolor = "# FFFFFF"> <BR> <p> The page frame is used on this page, but is not supported by your browser. </P> <BR> </body> <BR>
Action. php
The code is as follows:
Srand (double) microtime () * 1000000 );
$ Result = revert (0,100 );
Setcookie ("action", $ result, time () + 900 ,"/");
?>
Main.htm
The code is as follows:
Test