/ Published in: PHP
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
public function loginAction() { $form = new Application_Form_Login(); if ($this->getRequest()->isPost()){ if ($form->isValid($this->getRequest()->getPost())){ $username = $form->getValue('username'); $userpass = $form->getValue('userpass'); $adapter = new Application_Model_AuthAdapter($username, $userpass); $result = $this->_auth->authenticate($adapter); if ($result->isValid()){ // Success. // Redirect... } else { } } else { } } $this->view->form = $form; }