I'm developing a small app. using php and Zend Framework. I have a form, and I use it's controller to view the form. Now I need to manipulate the form data and redirect the user accordingly. here is my controller
<?php
class NewuserController extends Zend_Controller_Action {
public function init()
{
/* Initialize action controller here */
}
public function newuserAction()
{
$this->view->newuser;
}
public function adduserAction(){
$data = $this->getRequest()->getParams();
$u = new User();
$u->setUserName($data['uName']);
$u->setPrepwd($data['pwd']);
$u->setPrepwd($data['pwd']);
if($u->isEqual()){
$val = $u->addUsers();
if($val)
$this->_helper->redirector('main','main');
}
else
$this->_helper->redirector('newuser','newuser');
}
}
?>
my view is newuser.phtml
. In the action
attributr of the <form>
I have specified Newuser/adduser
. But when I submit the form it again displays the newuser.phtml
.
Why is this?
Thanks in advance
Charu