How to make the foreground page and the page in the process of page creation without refreshing the pages
It's always a problem to keep an interactive background CGI page. Here are two I put in practice
The method used.
Method One: Interact with cookies. There are altogether three documents, respectively:
Index.htm,action.php,main.htm
Principle for foreground page main.htm and background action.php via page frame
Index.htm organized and set the page width of the action.php to 0, which does not
affect the display. Action.php the information into a cookie, main.htm by reading
Cookies to enable interaction. The main.htm can also be re-read by action.php
To implement control of the background CGI program.
Index.htm
---------------------------------------------------------------
<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
---------------------------------------------------------------
Srand (Double) microtime () *1000000);
$result =rand (0,100);
Setcookie ("Action", $result, Time () +900, "/");
?>
---------------------------------------------------------------
Main.htm
---------------------------------------------------------------
<title>Test</title>
Re-reading Cookies
---------------------------------------------------------------
Method Two: Directly through the parent.*.* to realize the interaction. There are altogether three documents, respectively:
Index.htm,action.php,main.htm, where index.htm is the same as in front.
Principle for direct transmission via Parent.rightFrame.test.current_cookie.value
Information.
action.php
---------------------------------------------------------------
Srand (Double) microtime () *1000000);
$result =rand (0,100);
?>
---------------------------------------------------------------
Main.htm
---------------------------------------------------------------
<title>Test</title>
Re-reading Cookies
---------------------------------------------------------------
The above describes the search engine optimization PHP and JavaScript two ways to interact, including the search engine optimization aspects of the content, I hope to be interested in PHP tutorial friends helpful.