Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7447695
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T12:41:35+00:00 2026-05-29T12:41:35+00:00

I am getting the following error on line 17 Fatal error: Call to a

  • 0

I am getting the following error on line 17 Fatal error: Call to a member function set_rules() on a non-object

I have the form_validation library on autoload.

    public function login()
    {
            $this->form_validation->set_rules('userName','userName', 'required|valid_email|trim|max_length[99]|xss_clean');
            $this->form_validation->set_rules('userPassword','userPassword', 'required|trim|max_length[200]|xss_clean|callback__checkUser');

            if($this->form_validation->run() === TRUE) {
            // set CLEAN data in the session.
                redirect('admin/dashboard');
            }else{

            $this->index();
        }
    }

Controller

<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Login extends CI_Controller {


    public function index()
    {
        $data['companyName'] = $this->core_model->companyName();
        $data['pageTitle'] = "Administration Login";
        $this->load->view('admin/assets/header', $data);
        $this->load->view('admin/login.php', $data);
        $this->load->view('admin/assets/footer');
    }

    public function login()
    {
            $this->form_validation->set_rules('userName','userName', 'required|valid_email|trim|max_length[99]|xss_clean');
            $this->form_validation->set_rules('userPassword','userPassword', 'required|trim|max_length[200]|xss_clean|callback__checkUser');


            if($this->form_validation->run() === TRUE) {
            // set CLEAN data in the session.
                redirect('admin/dashboard');
            }else{

            $this->index();
        }
    }

    function _checkUser(){ // Private function 
        extract($_POST);

        $login = $this->admin_model->check_login($userName,$userPassword,$userGroup,$userEmail,$userActive);

        if(! $login){
            $this->session->set_flashdata('login_error', TRUE); 
            $this->form_validation->set_message('_checkUser','Sorry your %s is not correct');

            return FALSE;

    }else{
        if($user->userGroup == "admin" && $user->userActive == "yes")
        {
        $this->session->set_userdata('logged_in', TRUE);
        $this->session->set_userdata('userID', $user->id);
        $this->session->set_userdata('userName',$user->userName);
        $this->session->set_userdata('firstName',$user->userFirstName);
        $this->session->set_userdata('lastName',$user->userLastName);
        $this->session->set_userdata('userEmail',$user->userEmail);
        $this->session->set_userdata('userGroup',$user->userGroup);
        $this->session->set_userdata('userActive',$user->userActive);
        }else{
        $this->session->set_flashdata('login_error', TRUE); 
        $this->form_validation->set_message('_checkUser','Sorry your %s is not correct');

        return FALSE;
    }

    }

    }
}

/* End of file login.php */
/* Location: ./application/controllers/admin/login.php */
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T12:41:44+00:00Added an answer on May 29, 2026 at 12:41 pm

    Did you forgot to write the constructor?

    class Login extends CI_Controller {
    
        function __construct() {
            parent::__construct();
            $this->load->library('form_validation');
        }    
    
        ...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Getting the following the error : Fatal error: Call to a member function load()
When submitting the following form I am getting this error : Fatal error: Call
With vBulletin in PHP, I'm getting this error Fatal error: Call to a member
I am getting the following error with my drupal website. Fatal error: Call to
I am getting the following error: Fatal error: Call to undefined method MDB2_Error::quoteIdentifier() The
I'm getting the following error on the line of code below: Syntax error (missing
I am getting the following error when I get to the line that invokes
I'm getting an unexpected T_CONCAT_EQUAL error on a line of the following form: $arg1
I am getting an Incorrect syntax near '+' error at the following line: Select
I'm trying to run the following line: Directions.loadFromWaypoints((Waypoint[])waypoints.toArray(), opts); But I'm getting: 23:41:44.595 [ERROR]

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.