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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T13:06:20+00:00 2026-05-28T13:06:20+00:00

I have made a login system through zend auth here is the code //

  • 0

I have made a login system through zend auth here is the code

// userAuthentication
   public function authAction(){
       $request     = $this->getRequest();
       $registry    = Zend_Registry::getInstance();
       $auth        = Zend_Auth::getInstance(); 
       $DB = $registry['DB'];
           $authAdapter = new Zend_Auth_Adapter_DbTable($DB);
               $authAdapter->setTableName('user')
                            ->setIdentityColumn('user_name')
                            ->setCredentialColumn('user_password');

      $username = $request->getParam('username');
      $password = $request->getParam('password');
      $authAdapter->setIdentity($username);
      $authAdapter->setCredential($password);
      $result = $auth->authenticate($authAdapter);

      if($result->isValid()){
           $data = $authAdapter->getResultRowObject(null,'password');
           $auth->getStorage()->write($data);
           $this->_redirect('/login/controlpannel');
       }else{
           $this->_redirect('/login/login');
        }
  }

This work fine now. There is user_id (column) in user (table) where there are username and password too. I need to get that specific user_id from this table which just login and put it in session through

$user_session = new Zend_Session_Namespace('user_session');
$user_session->username = $username;
$user_id->user_id       = $user_id;

so that I can query some info against this $user_id and pass the result into view (name) controlpanel

  • 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-28T13:06:20+00:00Added an answer on May 28, 2026 at 1:06 pm

    Get user id from storage :

    $userInfo = Zend_Auth::getInstance()->getStorage()->read();
    
    echo $userInfo->user_id;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using PHP5 here. I have made a login system that check's the username
I have a website made with CakePHP 1.3.7. This website has it's own login
I have made a login system with 3 different classes of users. My requirement
I made my own login system in nodejs and I have couple question about
I have made a web application that uses master page for Login & Logout
I have made some code which exports some details of a journal article to
I have made a new windows service which works fine using barebone code (just
I have made a MVC application that uses the built-in ASP.NET login functions. It
I have dotnetnuke application and I made a custom login module. And everything works
I am trying to make a login form through Oracle's Form Builder, I have

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.