如何从php中的两个diffrant页面获取两个值
问题描述:
亲爱的先生,
我想从page1.php和page2.php获得两个值。
来自page1.php的
我想获得val1。从page2我想在main.php页面中获取val2。
在main.php中的
我想在文本框中绑定val1,在隐藏字段中绑定val2。
plz help。 ..
dear sir,
i want to get two values from page1.php and page2.php.
from page1.php i want to get val1. and from page2 i want to get val2 in main.php page.
in main.php i want to bind val1 in textbox and val2 in hidden field.
plz help...
答
查找php会话:使用
_SESSION变量。
有两个选项(和其他选项存在):
如果页面互相调用,则可以通过表单加载值并传递单页到另一个。或者,您可以使用AJAX加载会话变量
由于php是服务器端,这将需要某种类型的javaScript事件触发器。
_SESSION variables.
A couple of options (and others exist):
If pages call one another, the values can be loaded via a form and passed one-page-to-another. Or, you may use AJAX to load the session variable
Since php is serverside, this will require some sort of trigger by a javaScript event.