Home  >  Article  >  php教程  >  PHP与Javascript的两种交互方式

PHP与Javascript的两种交互方式

WBOY
WBOYOriginal
2016-06-21 09:04:22875browse

 在网页制作过程中怎样在不刷新页面的情况下使前台页面和
后台CGI页面保持交互一直是个问题。这里介绍两个我在实践中使
用的方法。

    方法一:通过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
---------------------------------------------------------------


Test




  
  
<br>   <br>  <p></p>
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn