2012-04-13 38 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