在php中将隐藏字段中的值从一个页面传递到另一个页面
我有一个简单的注册表。 我想将一页中输入的值传递到文本字段中的其他页面。 如何在 php.ini 中从下一页传递和访问它
这是我的第一个 php 页面。
提前致谢。
I have a simple registration form.
I want to pass value entered in one page to other in a text field.
how to pass and access it from next page in php.
this is my first php page.
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可以在 HTML 中添加隐藏字段并在 PHP 中访问它们:
然后在 PHP 中:
如果您要再次输出此内容,您应该使用
htmlspecialchars
或类似的东西来防止注入攻击。You can add hidden fields within HTML and access them in PHP:
Then in PHP:
If you're going to ouput this again you should use
htmlspecialchars
or something similar to prevent injection attacks.假设这是页面 A 中的表单输入
在页面 B 中
在您想要获取值的页面中放置此代码
这样您就可以使用变量值或将变量值附加到另一个表单中 做您想做的其他事情
Suppose this the form input in page A
In page B
In the page you want to get values put this code
So yo can use or attach variable value to another form do what else you want to do
使用下面的代码,应该对你有帮助。
在 formhandler.php 文件中,您需要输入以下代码来获取 inputfiled 的值。
use following code, that should help you.
on formhandler.php file yo need to enter following code to get the value of inputfiled.