如何在不知道表单内部控件名称的情况下获取表单中的GET/POST元素 [英] How to fetch the GET/POST elements in a form without knowing the name of the controls inside the form

查看:44
本文介绍了如何在不知道表单内部控件名称的情况下获取表单中的GET/POST元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有物品清单.当用户单击项目时,将使用文本框<input type="text" name="(DYNAMICALLY ASSIGNED VALUE)" />

I had the list of items. When the user clicks a item, a div is generated with a textbox <input type="text" name="(DYNAMICALLY ASSIGNED VALUE)" />

因此用户可以选择多个项目.对于每个项目,将在表单内部动态生成一个文本框.当用户单击提交按钮时,我想获取GET/POSTED元素.我们如何实现这一目标?请帮助.任何帮助将不胜感激.

So user can select multiple items. For each item a textbox is generated dynamically inside the form. When the user clicks the submit button, i want to fetch the GET/POSTED elements. How can we achieve that?. plz help. Any help will be appreciated.

推荐答案

您可以使用for-each循环:

You can use a for-each loop:

foreach ($_GET as $get_key => $get_value)

这篇关于如何在不知道表单内部控件名称的情况下获取表单中的GET/POST元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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