【发布时间】:2014-04-14 04:54:31
【问题描述】:
我尝试使用表单助手 CI 创建更新表单。如果在 form_input 上一切正常。但是,当 form_hidden 上的 id 时,它返回 NULL。这是脚本 正在查看
$hidden = array('name'=>'id_hidden','value'=>$datacompany[0]->id);
echo form_hidden($hidden); //I have edited
在控制器上
function edit_company()
{
if(isset($_POST['EDIT']))
{
print_r($_POST);//return All value
$isi = array(
'id' =>$this->input->post('id_hidden'),//return null
'nip' =>$this->input->post('nip'),//return value
'nama' =>$this->input->post('nama'), //return value
'golongan' =>$this->input->post('golongan') //return value
);
echo $isi['id']; //the result id is null
}//end if
}//end Function
我需要在模型上使用的那个 ID。我该如何解决? 如何从 form_hidden 中获取 ID?
非常感谢您的回答
谢谢
【问题讨论】:
-
它真的打印在 html 上吗?你看到一个结构良好的隐藏输入字段吗?
标签: php forms codeigniter post