做用户注册时出现了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:47 编辑
朋友建议你去看看 论坛里面的视频教程。有专门说注册的。可以帮助你快速上手!
模型里不能出现这段话吧,虽然你上面的代码里没什么用:
$name = $this->input->post('name');
$password = $this->input->post('password');
你的控制器逻辑也有点乱,硬是没看懂` 有木有写$this->load->helper('url')?? $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;
/* 配置文件config.php中
第297行 $config['csrf_protection'] = TRUE;
修改为 $config['csrf_protection'] = FALSE;
我也没弄好呢
教程里面 就有
页:
[1]