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 8069487
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T13:04:00+00:00 2026-06-05T13:04:00+00:00

I am having a bit of an issue with my _callback function: What I

  • 0

I am having a bit of an issue with my _callback function:

What I am trying to achieve with the below code is that:

  • If that the user details are not correct it shows the $message error (Does not currently show)
  • If nothing has been entered and submit has been entered I would like it to display “Please Login”.

Controller:

public function loginUser() {
    $this->form_validation->set_rules('userEmail','Username', 'required|valid_email|trim|max_length[99]|xss_clean');
    $this->form_validation->set_rules('userPassword','Password', 'required|trim|max_length[200]|xss_clean|callback__checkUsernamePassword');

    if($this->form_validation->run() === TRUE) {

    }
}

Callback:

function _checkUsernamePassword() {
    $username = $this->input->post('userEmail');
    $password = $this->input->post('userPassword');
    $user = $this->user_model->check_login($username,$password);

    if(! $user)
    {
        $data['contentMangement'] = $this->options_model->systemOptions();
        $data['pageTitle'] = 'Add User';
        $data['message'] = form_error('userEmail','<div class="alert alert-error">', '</div>'); 
        $this->load->view('_assets/header', $data);
        $this->load->view('addUser', $data);
        $this->load->view('_assets/footer');
        $this->form_validation->set_message('_checkUsernamePassword', 'Sorry %s is not correct.');
        return FALSE;
    }else{
        echo 'sheepdogs';
        return TRUE;
    }
}
  • 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-06-05T13:04:02+00:00Added an answer on June 5, 2026 at 1:04 pm

    I resolved this by changing my _callback too:

     function _checkUsernamePassword() {
    
            $username = $this->input->post('userEmail');
            $password = $this->input->post('userPassword');
    
            $user = $this->user_model->check_login($username,$password);
    
            if(! $user)
            {
                $this->form_validation->set_message('_checkUsernamePassword', 'Sorry the details you provided have not been found');
                return FALSE;
            }else{
                return TRUE;
            }   
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Having a bit of an issue please see the following code: window.onload = function
I'm having a bit of an issue with a query and scaling that query
I'm having issues with a bit of code that I am writing in C#.
Well I'm having a bit of an issue, I have an application that uses
I am having a bit of an issue with a click event not firing
Coming from Win32, I am having bit of an issue or a problem trying
I'm having a bit of an issue with grep that I can't seem to
I'm having a bit of an issue with trying to move groups of 17bit
I'm having a bit of issue with events in prototype. I'm trying to bind
been trying to figure out Android layouts and having a bit of an issue.

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.