为什么用$_POST不能获取数据问题
视图代码如下<form name="form1" method="post" action="<?=site_url('adminz/category_update')?>"> <?php foreach($category as $vote): ?> |- <input type=hidden name=category_id value='<?=$vote->category_id?>'/> <input name="categoryname" type="text" id="username" value='<?=$vote->category_name?>' size="25"> <input type="submit" name="button" id="button" value="提交"> <?=anchor('adminz/category_delete/'.$vote->category_id,'删除')?><br> <?php endforeach;?>
能正常读取到数据(有多行结果)
但无论是点哪一行的修改,在视图,或在模型中,过$_POST,还是$this->input->post();取得的都是最后了行的category_id 和categoryname的值
哪位能帮帮忙解决这个问题
name=category_id 改成 name="category_id[]"
name="categoryname" 改成 name="categoryname[]" jeongee 发表于 2011-8-23 20:48 static/image/common/back.gif
name=category_id 改成 name="category_id[]"
name="categoryname" 改成 name="categoryname[]"
怎么取得相应数所呢,如果$_POST['category_id']只是一个数组,$_POST['category_id'] []这各结构怎么取啊
fenfeng 发表于 2011-8-23 20:56 static/image/common/back.gif
怎么取得相应数所呢,如果$_POST['category_id']只是一个数组,$_POST['category_id'] []这各结构怎么 ...
都拿到数组了,循环遍历啊....... zhouli520 发表于 2011-8-23 21:45 static/image/common/back.gif
都拿到数组了,循环遍历啊.......
希望达到的效果是当我选“修改”时,对当前指定的一列作修改,如果是数组,用循环遍历怎么能指定到当前列的特定表单值
页:
[1]