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

  • Home
  • SEARCH
  • 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 8276287
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T08:19:52+00:00 2026-06-08T08:19:52+00:00

creating a basic log in page – it was working but then we changed

  • 0

creating a basic log in page – it was working but then we changed our database and our redirect is no longer working.

when we go to log in the site comes back saying that the username/password is incorrect, after checking the sql code that the site is checking against the database – it is sending the correct information but not allowing us to log in.

we want the user when they log into the site to get redirected to the eboxs(controller) home(view).

here is the code in the controller for logging in

    public function login(){

    $this->set('title_for_layout', 'Individual Registration');
    $this->set('stylesheet_used', 'style');
    $this->set('image_used', 'eBOXLogo.jpg');

    if ($this->request->is('post')){
        if ($this->Auth->login()){
            $username = $this->request->data['User']['username'];
            if (0 === $this->User->find('count',array('conditions'=>array('activated'=>true,'username'=> $username)))){
                $this->Session->setFlash('Sorry, your account is not validated yet.');
                $this->redirect($this->referer());
                } 
            else{
                $this->Auth->user('id');
                $this->redirect( array('controller' => 'Eboxs','action' => 'home'));
                }
        }  

        else{
            $this->Session->setFlash('Username or password is incorrect');
        }
    }else{
        $this->Session->setFlash('Welcome, please login');
    }


}

here is the code for the view

<?php    
         echo $this->Form->create('User', array('action' => 'login'));
         echo $this->Form->input('username');
         echo $this->Form->input('password');
         echo $this->Form->end('Login');

     ?> 
  • 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-08T08:19:55+00:00Added an answer on June 8, 2026 at 8:19 am

    Enable the debug mode to ‘2’ in core.php file when you are changing database or you can remove the model cache. You can later on change the debug mode to 0 in the production site. Also check that you have a valid username and password in the users table of the new database.Also check the structure of the password field.It should be varchar 255.

    Also Modify the above logic to –

    if ($this->Auth->login()){
      $username = $this->request->data['User']['username'];
      if (0 === $this->User->find('count',array('conditions'=>array('activated'=>true,'username'=> $username)))) {
    
         $this->Session->setFlash('Sorry, your account is not validated yet.');
         $this->redirect($this->referer());
       } else {
        $this->Auth->user('id');
        $this->redirect( array('controller' => 'Eboxs','action' => 'home'));
       }   
    } 
    

    In view file instead of using

    echo $this->Form->create('User', array('action' => 'login'));
    

    Try using –

    echo $this->Form->create('User', array('url' => array('controller' => 'users', 'action' => 'login')));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My current class is planning on creating a basic networked game, but we have
I am working on my first ever android app, and I'm creating basic exercise/calorie
I am creating a horizontal scroll site. Don't hate! Everything seems to be working
I'm creating a basic database utility class in Python. I'm refactoring an old module
I'm creating a basic jquery plugin but the extend doesn't seem to work.. I'm
I'm working on creating basic password security on a medium size PHP CodeIgniter website.
I'm creating some basic OO scripts using MySQLi and getting an Undefined Method error
I'm creating a basic forum where every message contains the authors name, some text
I'm creating a basic form with ajax submit using jquery framework. This is my
I am creating a basic screensaver for a small project for college and I

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.