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:

class Login extends Controller {
function login() {
//index for showing the login form
function index() {
//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;
$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() {
$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 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.