We are using
The way PHP interacts with javascript: interacting with cookies. There are altogether three documents, respectively:
Index.htm,action.php,main.htm
Principle for the foreground page main.htm and backstage action.php through the page frame, index.htm organization, 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 by reading
Cookies to enable interaction. Control of the background CGI program can also be achieved in main.htm by re-reading the action.php.
Implementation code for PHP interaction with javascript:
- < html >
- < head >
- < title>Test< /title >
- < meta http-equiv="Content-type"
content = "text/html; charset=gb2312 ">
- < /head >
- < frameset framespacing = " 0 "
border = "false" frameborder = "0" cols = "0,*" >
- < frame name = "Leftframe" scrolling = "No"
noresize src = "action.php" >
- < frame name="rightframe " Scrolling="Auto"
src = "Main.htm" >
- < /frameset > < noframes >
- < body bgcolor="#FFFFFF">
- < p> page frames are used, but your browser does not support them. < / p>
- < /body >
- < /noframes >
- < /html >
- < ?
- Srand (Double) microtime () *1000000);
- $ result = Rand (0,100);
- Setcookie ("Action", $result, Time () 900, "/");
- ?>
The above is the specific implementation of PHP and JavaScript interaction.
http://www.bkjia.com/PHPjc/446054.html www.bkjia.com true http://www.bkjia.com/PHPjc/446054.html techarticle we're using PHP to interact with javascript: interacting with cookies. Total is three files, respectively: index.htm,action.php,main.htm principle for the front page main.htm and backstage acti ...