使用php在HTML页面之间传递数据 [英] Pass data between HTML pages using php
本文介绍了使用php在HTML页面之间传递数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否存在使用会话在不使用表单的情况下在页面之间传递数据的替代方法。
Is there an alternate way to pass data between pages using sessions without using forms on click of an image button.
推荐答案
没有PHP
vsJS
。客户端和服务器端都有。如果您需要将数据从一个PHP
脚本传递到另一个脚本,那么 Google是你的朋友 [ ^ ]。您也可以免费使用 Google 进行相关搜索(例如,从JS
和PHP
)。
There's noPHP
vsJS
. There are instead client side and server side. If you need to pass data from onePHP
script to another one then Google is you friend[^]. You are also free of using Google for related searches (e.g. apssing data fromJS
andPHP
).
在对问题的评论中进行讨论之后,我可以得出结论:问题仍然不太正确。替代什么? :-)
无论如何,让我提醒你注意一个非常普遍的新方法,因为它在服务器端独立交换数据,即使是你没有任何服务器。这是网络存储空间
: http://en.wikipedia.org / wiki / Web_storage 。
如果你想在同一个密钥,任意数据结构上传递更多数据,你也可以使用JSON
对象,用于序列化和反序列化数据。您可以在我的文章的这一部分找到一个全面但简短的代码: JavaScript Calculator, 7。动态严格模式切换和网络存储 。
-SA
Following out discussion in the comment to the question, I can conclude: the question is still not quite correct. Alternative to what? :-)
Anyway, let me bring to your attention on newer approach which is very universal, because it exchanges data independent on your server side, and will work even if you don't have any server. This isWeb storage
: http://en.wikipedia.org/wiki/Web_storage.
If you want to pass more data at the same key, any arbitrary data structure, you can also useJSON
object, to serialize and deserialize data. You can find a comprehensive but short code in this section of my article: JavaScript Calculator, 7. Dynamic Strict Mode Switching and Web Storage.
—SA
这篇关于使用php在HTML页面之间传递数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文