我无法在index.php之后加载所有控制器。 Codeigniter请求响应:
未找到404页
我的codeigniter版本是3.0。
控制器演示:
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Reg extends CI_Controller {
public function __construct()
{
parent::__construct();
$this->load->model('reg_model');
$this->load->library('form_validation');
$this->load->library('toa_form_validation');
}
public function index()
{
$this->load->view('header');
$this->load->view('register/reg.php');
$this->load->view('footer');
}
public function aut()
{
$meli_code=filter_var($this->input->post('meli_code'), FILTER_SANITIZE_NUMBER_INT);
$password=$this->input->post('password');
$re_password=$this->input->post('re_password');
$tellphone=filter_var($this->input->post('tellphone'), FILTER_SANITIZE_NUMBER_INT);
$capt=$this->input->post('capt');
$ruls=array(
array(
'field' => 'meli_code',
'label' => 'roll',
'rules' => 'code_meli|required|melicode_check[' . $meli_code . ']'
),
array(
'field' => 'password',
'label' => 'roll ',
'rules' => 'required|matches[re_password]|max_length[10]|password_ch[' . $password . ']'
),
array(
'field' => 'tellphone',
'label' => 'roll',
'rules' => 'required|tellphone['.$tellphone.']'
),
array(
'field' => 're_password',
'label' => 'roll',
'rules' => 'required'
),
array(
'field' => 'capt',
'label' => 'roll ',
'rules' => 'callback_capt_check|required'
)
);
// $this->form_validation->set_rules("password","roll",'required|matches_array[input---conf_password]');
$this->form_validation->set_message('required','%s');
$this->form_validation->set_message('matches','roll');
$this->form_validation->set_rules($ruls);
if ($this->form_validation->run() == false)
{
$this->load->view('header');
$this->load->view('register/reg.php');
$this->load->view('footer');
}
else
{
$this->reg_model->insert_first_info($meli_code,$password,$tellphone);
$this->session->set_userdata(array('activepanel'=>1,'code_meli'=>$meli_code,'tellphone'=>$tellphone,));
redirect(site_url('bank/'), 'refresh');
}
}
function capt_check($str)
{
//echo $str;
if ($str != $this->session->userdata('capt'))
{
$this->form_validation->set_message('capt_check', 'roll');
return FALSE;
}
else
{
return TRUE;
}
}
function loginuser()
{
$this->load->view('header');
$this->load->view('register/login.php');
$this->load->view('footer');
}
function loginauh()
{
$meli_code=filter_var($this->input->post('meli_code'), FILTER_SANITIZE_NUMBER_INT);
$password=$this->input->post('password');
$capt=$this->input->post('capt');
$ruls=array(
array(
'field' => 'meli_code',
'label' => 'roll ',
'rules' => 'code_meli|required'
),
array(
'field' => 'password',
'label' => 'roll ',
'rules' => 'required|max_length[10]|password_ch[' . $password . ']|login['.$meli_code.']'
),
array(
'field' => 'capt',
'label' => 'roll',
'rules' => 'callback_capt_check|required'
)
);
$this->form_validation->set_message('required','%s');
$this->form_validation->set_rules($ruls);
if ($this->form_validation->run() == false)
{
//echo $this->reg_model->user_login($meli_code,$password);
$this->load->view('header');
$this->load->view('register/login.php');
$this->load->view('footer');
}
else
{
$active_user=$this->reg_model->get_active_user($meli_code);
$this->session->set_userdata(array('activepanel'=>1,'code_meli'=>$meli_code,'active_user'=>$active_user));
redirect(site_url('bank'), 'refresh');
}
}
}