码迷,mamicode.com
首页 > 其他好文 > 详细

表单提交 多个name相同的input

时间:2014-12-11 15:34:14      阅读:171      评论:0      收藏:0      [点我收藏+]

标签:style   blog   io   ar   color   os   sp   for   on   

<form action="{:U(‘Index/test‘)}" method="post">
<foreach name="div" item="vo">
组名:<input type="text" value="{$vo.groupName}" name=gp[]><br><br>
用户名:<input type="text" value="{$vo.username}" name=user[]><br><br>
</foreach>
<input type="submit">
</form>
<?php
// 本类由系统自动生成,仅供测试用途
class IndexAction extends Action {
    public function index(){
    $this->display();
    }
    public function group(){
        header("Content-Type:text/html; charset=utf-8");
$User = M("groupuser");    // 实例化模型类
$data = $User->select();
$this->assign(‘div‘,$data);
$this->display(‘Index/index‘);
//dump($data);
    }
public function test(){
$Index = A(‘admin://Index‘);
$gp=$_POST[‘gp‘];
$user=$_POST[‘user‘];
dump($gp);
dump($user);
}

}

 

表单提交 多个name相同的input

标签:style   blog   io   ar   color   os   sp   for   on   

原文地址:http://www.cnblogs.com/hellowzd/p/4157444.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!