簡體   English   中英

Codeigniter表單不會發布

[英]Codeigniter forms won't post

由於某種原因,我無法在Formigniter 2.1.4中發布表單,老實說,我不知道我要去哪里出錯。 誰能看到任何明顯的問題? 沒有帖子數據返回,而是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";
    }
}

您沒有創建文本字段的名稱。

echo form_input(array('type'=>'text', 'id'=>'testt', 'name'=>'testt'));

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM