表单可以更改会话变量吗? [英] Can a form change session variables?

查看:66
本文介绍了表单可以更改会话变量吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




在第一页中,我声明了一个会话变量。然后,在相同的页面上,我创建一个包含变量的表单,该变量具有相同的名称

作为提到的会话变量。按提交按钮

表格的按钮我转到第二页,立即将我重新定向回第一页

(带有标题)。并且提到的变量确实没有我在表单中指定的值。


这意味着,该会话不会将表单变量识别为

会话变量,尽管这些变量具有相同名称的
。这是真的吗?

Hi,

In the first page I declare a session variable. Than, on the same
page, I make a form which contains a variable which has the same name
as the mentioned session variable. Pressing the "submit" button of the
form I go to the second page which immediately redirects me back to
the first page (with the "header"). And the mentioned variable does
NOT have the value which I have specified in the form.

It means, that session does NOT recognize the form variables as
session variables in spite on the fact that these variables have
identical names. Is that true?

推荐答案

感谢PHP的全局声明
thanks to PHP''s globals


1月12日,9:54 pm,Peter Pei < yan ... @ telus.comwrote:
On Jan 12, 9:54 pm, "Peter Pei" <yan...@telus.comwrote:

感谢PHP'的全局值
thanks to PHP''s globals



你的意思是什么?

What do you mean?


1月13日,03:51,Kurda Yon< kurda ... @ yahoo.comwrote:
On 13 Jan., 03:51, Kurda Yon <kurda...@yahoo.comwrote:

在第一页中,我声明了一个会话变量。比,在相同的

页面上,我创建一个包含变量的表单*具有相同的名称
In the first page I declare a session variable. Than, on the same
page, I make a form which contains a variable which *has the same name



PHP不会自动注册你的会话中的变量。


请查看 http://de.php.net/manual/en/ref.session.php 了解详情。


您是否访问过(预期)这样的表单/会话变量:

PHP does not automaticall register variables with your session.

Please review http://de.php.net/manual/en/ref.session.php for details.

Do you access your (expected) form/session variable like this:


这篇关于表单可以更改会话变量吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆