a35393071 发表于 2011-11-10 09:51:48

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

做用户注册时出现了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 编辑

朋友建议你去看看 论坛里面的视频教程。有专门说注册的。可以帮助你快速上手!

yuzhigang5460 发表于 2011-11-11 08:42:22

模型里不能出现这段话吧,虽然你上面的代码里没什么用:
$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;

/*

substr 发表于 2012-7-18 14:31:30

配置文件config.php中
第297行 $config['csrf_protection'] = TRUE;
修改为   $config['csrf_protection'] = FALSE;

goyuquan 发表于 2014-5-21 13:25:03

我也没弄好呢

ljc 发表于 2014-5-21 17:29:36

教程里面 就有
页: [1]
查看完整版本: 做用户注册时出现了The action you have requested is not allowed.