如何使用 HTML 表单将数组传递给 perl cgi 脚本?
在 HTML 表单中,如果我们使用 []
为输入框命名,就像这样
<input name="foo[]" type="text" />
<input name="foo[]" type="text" />
在 PHP 中,我们可以通过 $_POST['foo' 获取数组中这些输入框的值]
。
如何在 Perl 中做类似的事情?我用CGI.pm
In a HTML form, if we give names to input boxes with []
, like this
<input name="foo[]" type="text" />
<input name="foo[]" type="text" />
In PHP, we can obtain values of these input boxes in an array, with $_POST['foo']
.
How to do the similar in Perl? I use CGI.pm
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
只需将
param
的结果分配给一个数组即可。名称不要求以
[]
结尾。Just assign the result of
param
to an array.There's no requirement that the name end with
[]
.