方法一:通过Cookie交互。
一共是三个文件,分别为:index.htm,action.php,main.htm
原理为前台页面main.htm和后台action.php通过页面框架 index.htm组织起来,将action.php的页面宽度设为0,这样并不影响显示。action.php将信息放入cookie中,main.htm通过读取 cookie来实现交互。在main.htm中也可以通过重新读取action.php 来实现控制后台CGI程序。
index.htm
复制代码 代码如下:
<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="/UploadFiles/2021-04-02/action.php"><frame name="rightFrame" scrolling="auto" src="main.htm"></frameset><noframes>
<body bgcolor="#FFFFFF">
<p>本页使用页面框架,但是您的浏览器不支持。</p>
</body>
</noframes>
</html>

action.php
复制代码 代码如下:
<?php
srand((double)microtime()*1000000);
$result=rand(0,100);
setcookie("action",$result,time()+900,"/");
?>

main.htm
复制代码 代码如下:
<html>
<head>
<title>Test</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script language="javascript">
function get_cookie()
{
document.test.current_cookie.value=document.cookie;
}
</script>
</head>
<body bgcolor="#FFFFFF">
<form name="test" >
当前参数为<input type="text" name="current_cookie" size="80" maxlength="1000">
</form>
<script language="javascript">
setInterval("get_cookie()",200);
</script>
<br>
<a href="action.php" target="leftFrame">重新读取Cookie</a>
</body>
</html>

方法二:直接通过parent.*.*来实现交互。
一共是三个文件,分别为:index.htm,action.php,main.htm,其中index.htm和前面的一样。
原理为通过parent.rightFrame.test.current_cookie.value直接传递信息。
action.php
复制代码 代码如下:
<?
srand((double)microtime()*1000000);
$result=rand(0,100);
?>
<script language="javascript">
parent.rightFrame.test.current_cookie.value="<? echo $result?>";
</script>

main.htm
复制代码 代码如下:
<html>
<head>
<title>Test</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body bgcolor="#FFFFFF">
<form name="test" >
当前参数为<input type="text" name="current_cookie" size="80" maxlength="1000">
</form>
<br>
<a href="action.php" target="leftFrame">重新读取Cookie</a>
</body>
</html>
华山资源网 Design By www.eoogi.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
华山资源网 Design By www.eoogi.com

RTX 5090要首发 性能要翻倍!三星展示GDDR7显存

三星在GTC上展示了专为下一代游戏GPU设计的GDDR7内存。

首次推出的GDDR7内存模块密度为16GB,每个模块容量为2GB。其速度预设为32 Gbps(PAM3),但也可以降至28 Gbps,以提高产量和初始阶段的整体性能和成本效益。

据三星表示,GDDR7内存的能效将提高20%,同时工作电压仅为1.1V,低于标准的1.2V。通过采用更新的封装材料和优化的电路设计,使得在高速运行时的发热量降低,GDDR7的热阻比GDDR6降低了70%。