i have written an application(login page) using codeigniter 2.02. when i try to load the page, it displays the following message:

Fatal error: Class 'Controller' not found in /var/www/Files_Manager/application/controllers/login.php on line 2

this is the script:

<?php
class Login extends Controller {
//constructor
function login() {
parent::Controller();
$this->load->helper('url');
$this->load->helper('form');
$this->load->library('form_validation');
$this->load->library('session');
}
//index for showing the login form
function index() {
$this->load->view('login_view');
}
//this function will do the login process
function proseslogin() {
$username = $this->input->post('username'); //read the username that filled by the user
$password = $this->input->post('password'); //read the password that filled by the user
$passwordx = md5($password); //this is for change $password into MD5 form
//the query is to matching the username+password user with username+password from database
$q = $this->db->query("SELECT * FROM tb_user WHERE username='$username' AND userpass='$passwordx'");
if ($q->num_rows() == 1) {
// if the query is TRUE, then save the username into session and load the welcome view
$nama = $q->row()->username;
$this->session->set_userdata('username',$nama);
$data['welcome'] = "Welcome $nama";
$this->load->view('welcome_view', $data);
}
else {
// query error
$data['error']='!! Wrong Username or Password !!';
$this->load->view('login_view', $data);
}
}
//to do logout process
function logout() {
$this->session->sess_destroy();
$data['logout'] = 'You have been logged out.';
$this->load->view('login_view', $data);
}
}
?>

anybody help me solve it.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.