Hi every one first of all im new in zend and i need some help to start.
My problem is I have a login for like this
<form action="<?php echo $this->baseUrl ?>/user/login" method="post" id="login">
<input type="text" name="username" value=""/>
<input type="password" name="password" value=""/>
<input type="submit" name="submit" value="submit" />
</form>
and my controller is
Code: Select all public function loginAction() {
if($this->request->isPost()){
$f = new Zend_Filter_StripTags();
$user = $f->filter($this->_request->getPost('username'));
$pass1 = $f->filter($this->_request->getPost('password'));
try {
if(!empty ($user) && !empty ($pass1)){
$this->_redirect('/user/system');
$modelUser = new UserModel();
$data = $modelUser->authUser($username, $pass1);
if($data->isValid()){
$this->view->isvalid = "valido";
}
$this->view->data = $data;
$this->_redirect('/user/system');
}else {
return false;
}
} catch (Exception $exc) {
MainHelper::writeLog("Problem Login Action". $exc);
}
}
and my model
public function authUser($user , $pass)
{
$select = $this->select()
->from($_name)
->where('id_user = ?', $user)
->where('pass = ?', $pass );
$row = $this->fetchRow($select);
//if($row>0)
return $row->toArray();
}
My problem is when i try to login , the website is show me a blank page without code, whats wrong ? I know the controller and Model.
Thanks in advance