用户
 找回密码
 入住 CI 中国社区
搜索
查看: 8583|回复: 7
收起左侧

[HELP] 做用户注册时出现了The action you have requested is not allowed.

[复制链接]
发表于 2011-11-10 09:51:48 | 显示全部楼层 |阅读模式
做用户注册时出现了The action you have requested is not allowed.
请问,这个是什么问题呢?
我的模型:

                function addadmin_ini(){
                        $name = $this->input->post('name');
                         $password = $this->input->post('password');
                        $data = array(
               'name' => 'name' ,
               'password' => 'password'
            );
                        return $this->db->insert('admin', $data);        
                                       
                }

控制器:         function addadmin(){
                          /*$this->load->model('Madmin');
                          $data['addadmin'] = $this->Madmin->addadmin();*/
                          $this->load->view('admin/AddAdmin');
                  }
                 function addadmin_ini(){
                    if (isset($_POST['submit_admin'])){
                            $this->load->model('Madmin');
                      $this->model->Madmin();
                      redirect('admin/addadmin_ini');
                      echo '111';
                    } else {
                      $this->load->view('admin/AddAdmin');
                    }
                 }


是哪个环节出问题了呢?希望各位大虾帮忙解决下
发表于 2011-11-11 00:45:05 | 显示全部楼层
本帖最后由 Уаиɡ_輄 于 2011-11-11 00:47 编辑

朋友建议你去看看 论坛里面的视频教程。有专门说注册的。可以帮助你快速上手!
发表于 2011-11-11 08:42:22 | 显示全部楼层
模型里不能出现这段话吧,虽然你上面的代码里没什么用:
PHP复制代码
 $name = $this->input->post('name');
                         $password = $this->input->post('password');
复制代码


你的控制器逻辑也有点乱,硬是没看懂`
发表于 2011-12-2 00:47:24 | 显示全部楼层
有木有写$this->load->helper('url')??
发表于 2012-3-20 22:06:23 | 显示全部楼层
$config['global_xss_filtering'] = true;

/*
|--------------------------------------------------------------------------
| Cross Site Request Forgery
|--------------------------------------------------------------------------
| Enables a CSRF cookie token to be set. When set to TRUE, token will be
| checked on a submitted form. If you are accepting user data, it is strongly
| recommended CSRF protection be enabled.
|
| 'csrf_token_name' = The token name
| 'csrf_cookie_name' = The cookie name
| 'csrf_expire' = The number in seconds the token should expire.
*/
$config['csrf_protection'] = true;
$config['csrf_token_name'] = 'csrf_test_name';
$config['csrf_cookie_name'] = 'csrf_cookie_name';
$config['csrf_expire'] = 7200;

/*
发表于 2012-7-18 14:31:30 | 显示全部楼层
配置文件config.php中
第297行 $config['csrf_protection'] = TRUE;
修改为   $config['csrf_protection'] = FALSE;

发表于 2014-5-21 13:25:03 | 显示全部楼层
我也没弄好呢
发表于 2014-5-21 17:29:36 | 显示全部楼层
教程里面 就有

本版积分规则