由于某些原因,我不能在Codeigniter 2.1.4中发布表单,老实说,我不知道我错在哪里。有没有人能看到明显的问题?不返回post数据,只返回vardump返回的空表单(布尔值为false)
public function testpost()
{
$this->load->helper(array('form', 'url'));
$this->load->library('form_validation');
var_dump($this->input->post());
$this->form_validation->set_rules('testt', 'Test', 'required');
if ($this->form_validation->run() == FALSE)
{
echo validation_errors();
echo form_open('test/testpost');
echo form_input(array('type'=>'text', 'id'=>'testt'));
echo form_submit(array('value' => 'submit'));
echo form_close();
}
else
{
echo "true";
}
}发布于 2014-04-13 00:52:02
您没有创建文本字段的名称。
echo form_input(array('type'=>'text', 'id'=>'testt', 'name'=>'testt'));https://stackoverflow.com/questions/23031448
复制相似问题