2012-04-13 91 views
0

當我嘗試通過post方法傳遞變量通過窗體時,它會生成以下codeigniter錯誤「GENERAL_ERROR」。POST變量genarate與codeigniter的一般錯誤

+0

嗨,這個錯誤可以使用GENERAL_ANSWER輕鬆解決。祝你好運。 – deed02392 2012-04-13 10:19:36

+0

此表單是否具有操作屬性? – itachi 2012-04-13 10:21:26

+0

是的,它有以下動作action =「/ search」呼叫控制器「搜索」 – Ced 2012-04-13 10:33:56

回答

0

這兒有你

控制器/ test_form.php

<?php 
class Test_form extends CI_Controller 
{ 
    public function __construct() 
    { 
     parent::__construct(); 
    } 

    public function index() 
    { 
     if ($this->input->post()) 
     { 
      print_r($this->input->post()); 
     } 

     $this->load->view('test_form'); 
    } 
} 

的意見/ test_form.php

<form action="test_form" method="post"> 
    <input type="text" name="test_field_one" /> 
    <button type="submit">Go!</button> 
</form> 

也許你在你的代碼有一個錯字的地方,沒有一個很簡單的例子雖然我在黑暗中刺傷事物,但看到它。

+0

沒有特殊的代碼,只有一個簡單的形式(method =「post」)和一個輸入。發送表單時會生成錯誤。 – Ced 2012-04-13 10:19:39

+0

這裏是你的代碼錯誤:http://disquesoffice.bluesys2.ch/test_form。我想我應該有一個配置錯誤 – Ced 2012-04-13 10:39:10

+0

我從來沒有見過這個錯誤。它甚至不像一個代碼錯誤。你確定它安裝正確嗎? – Dale 2012-04-13 10:52:42