我們正在使用CodeIgniter 2.1.4構建Web應用程序。它處於爬行階段。目前,它只有一個基本的日誌記錄和註冊系統。致命錯誤:在生產服務器上找不到「CI_Model」類,在本地工作
什麼我們到目前爲止充當本地預期,但是當我們在網上嘗試一下,我們得到以下錯誤:
Fatal error: Class 'CI_Model' not found in /home4/csurmeli/public_html/other/ems/system/core/Common.php on line 174
它沒有任何意義,因爲我們沒有改變任何的核心文件。我們的在線服務器已經建立。
有什麼建議嗎?
控制器調用登錄:
function login(){
if($this->session->userdata('userid') !== false){
redirect(base_url()."index.php/users/success");
}
$data['error'] = 0;
if($_POST){
$this->load->model('user');
$username = $this->input->post('username',true);
$password = $this->input->post('password',true);
$user = $this->user->login($username,$password);
if(!$user){
$data['error']=1;
redirect(base_url()."index.php/users/error");
}else{
$this->session->set_userdata('userid',$user['userid']);
$this->session->set_userdata('privilege',$user['privilege']);
redirect(base_url()."index.php/users/success");
}
}
$this->load->view('header');
$this->load->view('login',$data);
$this->load->view('footer');
}
型號:
<?php if (! defined('BASEPATH')) exit('No direct script access allowed');
Class User Extends CI_Model{
public function __construct(){
parent::__construct();
}
function create_user($data){
if($data['is_sent']){
$query = array("username" => $data['username'],
"password" => $data['password'],
"email" => $data['email']
);
$this->db->insert('users',$query);
}
}
function login($username,$password){
$where = array(
'username'=>$username,
'password'=>$password
);
$this->db->select()->from('users')->where($where);
$query = $this->db->get();
return $query->first_row('array');
}
}
?>
可能的重複[致命錯誤:類'CI \ _Model'找不到](http://stackoverflow.com/questions/12503783/fatal-error-class-ci-model-not-found) – Anil