Home  >  Article  >  Backend Development  >  php 表提交获取post问题求组

php 表提交获取post问题求组

WBOY
WBOYOriginal
2016-06-20 12:34:49886browse

比如说:这张表单里是这样的



 
 
增加按钮,点击后加载
 
 
 
 

提交后,发送的post为:title  form  url form1   url1  form2 url2
php中
num =通过增加按钮获得的数值
i=1
当i 我怎么获取
form  url form1   url1  form2 url2 的值?达到以下的效果
 for (i=1;i ......
s .= form  url 
}

输出为:
s .= $_GET[form1]  url1...的值
s .= $_GET[form2]  url2...的值
.......


回复讨论(解决方案)

在你的这个应用中,表单控件应按数组形式命名
 

好处有二:
1、js 增加空间时不需要计算命名
2、提交后,php 会将他们解析成数组。也就没有了变量的变量拼装

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn