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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T11:21:16+00:00 2026-05-16T11:21:16+00:00

I have this controller set up for a login: <?php class Login extends Controller

  • 0

I have this controller set up for a login:

<?php
class Login extends Controller {

    function __construct() {
        parent::Controller();
        $this->form_validation->set_error_delimiters('', '');
        $this->output->enable_profiler(TRUE);
    }

    function index(){

        redirect('/login/terminal');

    }

    function terminal() {
    // terminal login

        $this->form_validation->set_rules(array('username','password'), 'Username', 'callback_terminal_login_check[$username,$password]');
        if ($this->form_validation->run() == FALSE) {
            $this->load->view('login_header');
            $this->load->view('login_terminal');
            $data['version'] = $this->master->GetVersion();
            $this->load->view('login_footer', $data);
        } else {
            redirect('/terminal');
        }

    }

    function terminal_login_check($username,$password) {
    // callback function to perform terminal login  

        if ($this->authentication->DoTerminalAuthentication($username,$password)) {
            echo $username;
            return TRUE;
        } else {
            $this->form_validation->set_message('terminal_login_check', 'Invalid');
            return FALSE;
        }


    }

}

What I am looking at is the line that does the form validation callback >> $this->form_validation->set_rules(array('username','password'), 'Username', 'callback_terminal_login_check[$username,$password]');

I know this is not right. Basically what I want to do is check the username and password against the Authentication->DoTerminalAuthentication model to process the user’s login. I want to pass the $username and $password form fields. Here is my form view if it helps:

<div id="title">Terminal Login</div>
<?php 
    if (validation_errors()) {
        echo '<div id="error">' . validation_errors() . '</div>';
    }
?>

<?=form_open('login/terminal');?>
<?=form_label('Username', 'username')?><br />
<?=form_input(array('id'=>'username','name'=>'username','value'=>set_value('username')))?><br />
<?=form_label('Password', 'password')?><br />
<?=form_password(array('id'=>'password','name'=>'password'))?><br />
<?=form_submit(array('name'=>'passwordsubmit','value'=>'Login >>'))?><br />
<?=form_close();?>
  • 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-16T11:21:17+00:00Added an answer on May 16, 2026 at 11:21 am

    As I understand it, form validation works on a field by field basis. To achieve what you want, I would attach the callback to one of the fields (probably the password field would be best) and then access the other form field data using the global POST array. This way you don’t need to pass anything to the callback function as parameters.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 529k
  • Answers 529k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer SSRS does not support multiple datasets per call. Another way,… May 16, 2026 at 11:14 pm
  • Editorial Team
    Editorial Team added an answer Performance depends on many things. Of course the semantics of… May 16, 2026 at 11:14 pm
  • Editorial Team
    Editorial Team added an answer If you just want to point to a pre-existing date,… May 16, 2026 at 11:14 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

So, I have set up a login page that verifies the user's credentials, and
I have an Acl plug-in which extends Zend_Controller_Plugin_Abstract , this plug-in handles all my
I'm currently in the process of setting my website, largely with php. Though this
This is going to sound quite bizarre. I have one ASP .NET MVC 2
I am using the core Auth component. I have created a user login that
I have a multi module Spring project that I set up using Maven: my-root
This is to be an application-agnostic question, but one I'd like to get a
I want to have users be able to upload .pdf and images and restrict
So I am creating a form builder. Users will login and then fillout the
I'm having a tough time getting this to work. Maybe my logic is all

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.