我们在使用
PHP与Javascript交互的方法:通过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程序。
PHP与Javascript交互的实现代码:
<ol class="dp-xml"> <li class="alt"><span><span class="tag"><span> </span><span class="tag-name">html</span><span class="tag">></span><span> </span></span></span></li> <li><span class="tag"><span> </span><span class="tag-name">head</span><span class="tag">></span><span> </span></span></li> <li class="alt"><span class="tag"><span> </span><span class="tag-name">title</span><span class="tag">></span><span>Test</span><span class="tag"><span> /title</span><span class="tag">></span><span> </span></span></span></li> <li><span class="tag"><span> </span><span class="tag-name">meta</span><span> </span><span class="attribute">http-equiv</span><span>=</span><span class="attribute-value">"Content-Type"</span><span> <br></span><span class="attribute">content</span><span>=</span><span class="attribute-value">"text/html; charset=gb2312"</span><span class="tag">></span><span> </span></span></li> <li class="alt"><span class="tag"><span> /head</span><span class="tag">></span><span> </span></span></li> <li><span class="tag"><span> </span><span class="tag-name">frameset</span><span> </span><span class="attribute">framespacing</span><span>=</span><span class="attribute-value">"0"</span><span> <br></span><span class="attribute">border</span><span>=</span><span class="attribute-value">"false"</span><span> </span><span class="attribute">frameborder</span><span>=</span><span class="attribute-value">"0"</span><span> </span><span class="attribute">cols</span><span>=</span><span class="attribute-value">"0,*"</span><span class="tag">></span><span> </span></span></li> <li class="alt"><span class="tag"><span> </span><span class="tag-name">frame</span><span> </span><span class="attribute">name</span><span>=</span><span class="attribute-value">"leftFrame"</span><span> </span><span class="attribute">scrolling</span><span>=</span><span class="attribute-value">"no"<br></span><span> noresize </span><span class="attribute">src</span><span>=</span><span class="attribute-value">"action.php"</span><span class="tag">></span><span> </span></span></li> <li><span class="tag"><span> </span><span class="tag-name">frame</span><span> </span><span class="attribute">name</span><span>=</span><span class="attribute-value">"rightFrame"</span><span> </span><span class="attribute">scrolling</span><span>=</span><span class="attribute-value">"auto"</span><span> <br></span><span class="attribute">src</span><span>=</span><span class="attribute-value">"main.htm"</span><span class="tag">></span><span> </span></span></li> <li class="alt"><span class="tag"><span> /frameset</span><span class="tag">></span><span class="tag"><span> </span><span class="tag-name">noframes</span><span class="tag">></span><span> </span></span></span></li> <li><span class="tag"><span> </span><span class="tag-name">body</span><span> </span><span class="attribute">bgcolor</span><span>=</span><span class="attribute-value">"#FFFFFF"</span><span class="tag">></span><span> </span></span></li> <li class="alt"><span class="tag"><span> </span><span class="tag-name">p</span><span class="tag">></span><span>本页使用页面框架,但是您的浏览器不支持。</span><span class="tag"><span> /p</span><span class="tag">></span><span> </span></span></span></li> <li><span class="tag"><span> /body</span><span class="tag">></span><span> </span></span></li> <li class="alt"><span class="tag"><span> /noframes</span><span class="tag">></span><span> </span></span></li> <li><span class="tag"><span> /html</span><span class="tag">></span><span> </span></span></li> <li class="alt"><span class="tag"><span> ? </span></span></li> <li><span>srand((double)microtime()*1000000); </span></li> <li class="alt"> <span>$</span><span class="attribute">result</span><span>=</span><span class="attribute-value">rand</span><span>(0,100); </span> </li> <li><span>setcookie("action",$result,time() 900,"/"); </span></li> <li class="alt"> <span class="tag">?></span><span> </span> </li> </ol>
以上就是PHP与Javascript交互的具体实现方法。

随着互联网的发展,SEO(SearchEngineOptimization,搜索引擎优化)已经成为了网站优化的重要一环。如果您想要使您的PHP网站在搜索引擎中获得更高的排名,就需要对SEO的内容有一定的了解了。本文将会介绍如何在PHP中实现SEO优化,内容包括网站结构优化、网页内容优化、外部链接优化,以及其他相关的优化技巧。一、网站结构优化网站结构对于S

随着电子商务和企业管理的发展,许多企业开始寻找更好的方法来处理其日常业务流程。ERP系统是一种能够整合企业各种业务流程的软件工具。它提供了全面的功能,包括生产、销售、采购、库存、财务等方面,帮助企业提高效率、控制成本和提高客户满意度。而在PHP编程语言中,也能够实现ERP系统,这就需要我们掌握一些基本的知识和技术。下面,我们将深入探讨如何在PHP中实现ERP

随着物联网技术的发展和普及,越来越多的应用场景需要使用PHP语言进行物联网开发。PHP作为一种广泛应用于Web开发的脚本语言,它的易学易用、开发速度快、可扩展性强等特点,使其成为开发物联网应用的一种优秀选择。本文将介绍在PHP中实现物联网开发的常用技术和方法。一、传输协议和数据格式物联网设备通常使用TCP/IP或UDP协议进行数据传输,而HTTP协议是一个优

随着企业的发展,客户管理变得越来越重要。为了提高客户满意度和忠诚度,越来越多的企业采用客户关系管理系统(CRM)来帮助其管理客户关系。而PHP是一种流行的编程语言,因其简单易学、灵活和强大而被广泛应用于Web开发。那么,如何在PHP中实现CRM系统呢?本文将为您介绍实现CRM系统的步骤和技巧。Step1:需求分析在开始开发CRM系统之前,您需要进行需求分析

哈医大临床药学就业前景如何尽管全国就业形势不容乐观,但药科类毕业生仍然有着良好的就业前景。总体来看,药科类毕业生的供给量少于需求量,各医药公司和制药厂是吸纳这类毕业生的主要渠道,制药行业对人才的需求也在稳步增长。据介绍,近几年药物制剂、天然药物化学等专业的研究生供需比甚至达到1∶10。临床药学专业就业方向:临床医学专业学生毕业后可在医疗卫生单位、医学科研等部门从事医疗及预防、医学科研等方面的工作。就业岗位:医药代表、医药销售代表、销售代表、销售经理、区域销售经理、招商经理、产品经理、产品专员、护

随着互联网的不断发展,越来越多的网站需要使用验证码来保证安全性。验证码是一种借助人类能力而无法被计算机破解的认证技术,广泛应用于网站注册、登录、找回密码等功能中。下面将介绍如何使用PHP实现验证码功能。一、生成验证码图片验证码图片的生成是验证码功能的核心,需要生成一个随机字符,并将其渲染为图像展示给用户。在PHP中,可以使用GD库来生成图片。GD库是一种用于

智能合约(SmartContract)是一种基于区块链的自动化交易程序,可以实现自动化执行、验证和执行交易。智能合约可以减少交易中的人为干扰,提高交易的安全性和效率。在不同的区块链中,智能合约的实现方式略有不同。本文将介绍在PHP中如何实现智能合约。PHP是一种广泛使用的编程语言,特别适合Web开发。PHP有着成熟的开源生态系统,以及许多可靠的框架和库。在

随着现代企业管理的需求与时俱进,各种管理软件如ERP、CRM、HRM和OA等软件的使用已经变得越来越普遍。特别是办公自动化(OA)软件,已经成为企业必不可少的一部分。随着PHP发展的越来越成熟,越来越多的企业开始使用PHP作为开发OA软件的工具,并取得了很好的效果。那么,在PHP中如何实现OA开发呢?确定OA的需求在开始OA的开发之前,必须先明确自己的OA需


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Dreamweaver CS6
Visual web development tools

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

WebStorm Mac version
Useful JavaScript development tools

Atom editor mac version download
The most popular open source editor

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.
