I am really sorry to answer you this way, but it looks like you don't
understand how Zend Framework's MVC works.
That return $this->_forward('list');  is like an internal redirect.
I suggest you a read of
http://framework.zend.com/manual/en/learning.quickstart.intro.html :)
Marco Pivetta
http://twitter.com/Ocramius
http://marco-pivetta.com



On 12 November 2011 22:18, vindu525 [via Zend Framework Community] <
[email protected]> wrote:

> Thank you Marco pivetta
>
> The values are getting inserted into the database , but still i dont know
> why this error occuring
>
> //complete controller
>
>
> <?php
>
> class SignupController extends Zend_Controller_Action
> {
>
>     public function init()
>     {
>         /* Initialize action controller here */
>     }
>
>     public function indexAction()
>     {
>         $auth = Zend_Auth::getInstance();
>                 if($auth->hasIdentity()){
>                         $this->view->identity = $auth->getIdentity();
>                         }
>     }
>
>     public function createAction()
>     {
>         $userForm = new Form_SignUpForm();
>                 if($this->_request->isPost())
>                 {
>                         if($userForm->isValid($_POST))
>                         {
>                                 $userModel = new Model_SignUpForm();
>                                 $userModel->createUser(
>                                         $userForm->getValue('fullname'),
>                                         $userForm->getValue('username'),
>                                         $userForm->getValue('password'),
>                                         $userForm->getValue('email'),
>                                         $userForm->getValue('dob'),
>                                         $userForm->getValue('gender')
>                                 );
>                                 return $this->_forward('list');
>                         }
>                 }
>
>                 $userForm->setAction('/LC_Case/public/signup/create');
>                 $this->view->form = $userForm;
>     }
>
>         public function loginAction()
>         {
>                 $userForm = new Form_SignUpForm();
>                 $userForm->setAction('/LC_Case/public/signup/login');
>                 $userForm->removeElement('fullname');
>                 $userForm->removeElement('username');
>                 $userForm->removeElement('dob');
>                 $userForm->removeElement('gender');
>                 $this->view->form = $userForm;
>
>                 if($this->_request->isPost() &&
> $userForm->isValid($_POST)){
>                         $data = $userForm->getValues();
>                         //set up the authrisation adapter
>                         //get the default database adapter
>                         $db = Zend_Db_Table::getDefaultAdapter();
>                         //creationg auth adapter
>                         $authAdapter = new
> Zend_Auth_Adapter_DbTable($db,'users','password','email');
>                         //setting username and password
>                         $authAdapter->setIdentity($data['username']);
>
> $authAdapter->setCredential(md5($data['password']));
>                         //Authentication
>                         $result = $authAdapter->authenticate();
>                         if($result->isValid()){
>                                 //Storing firstname,lastname of user
>                                 $auth = Zend_Auth::getInstance();
>                                 $storage = $auth->getStorage();
>
> $storage->write($authAdapter->getResultRowObject(
>
> array('fullname','username','email','dob','gender')));
>                                         return $this->_forward('index');}
>                         else{
>                                 $this->view->loginMessage = "Either
> Email-id or password incorrect!";
>                                 }
>                 }
>                         $this->view->form->$userForm;
>         }
>
>
>
> }
>
>
> ?>
>
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://zend-framework-community.634137.n4.nabble.com/ZF2-Database-configuration-tp4033733p4035301.html
>  To unsubscribe from Zend Framework Community, click 
> here<http://zend-framework-community.634137.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=634137&code=b2NyYW1pdXNAZ21haWwuY29tfDYzNDEzN3wxNzE0OTI1MTk4>
> .
> See how NAML generates this 
> email<http://zend-framework-community.634137.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.InstantMailNamespace&breadcrumbs=instant+emails%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>


--
View this message in context: 
http://zend-framework-community.634137.n4.nabble.com/ZF2-Database-configuration-tp4033733p4035358.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to