Online PHP editor is going to be changed...

We are going to:

  1. Redesign the site
  2. Work with SSH instead of FTP
  3. Switch to HTTPS
  4. Work without "session" to improve security
  5. And, of course, remain open source

Please consider...

  1. Checking our new PHP blog
  2. Visit the new Facebook page

I'm using SSH and I will continue using

<? Online-PHP::Tutorials ?>

« Back

  • ZF: Create the loginAction - receive login form, and authenticate.


    Example of a controller action for authenticating the request from the login form

        public function loginAction()
            // check that this is POST request
            $req = $this->getRequest();
            if (!$req->isPost()) {
            // get the database resource
            $db = Zend_Registry::getInstance()->get('db');
            // get POST parameters
            $login = $this->getParam('login');
            $password = $this->getParam('password');
            // define the adapter
            $authAdapter = new Zend_Auth_Adapter_DbTable($db);
            // authenticate
            $auth = Zend_Auth::getInstance();
            $result = $auth->authenticate($authAdapter);
            if ($result->isValid()) {
                $data = $authAdapter->getResultRowObject(null, 'password'); // without password