嗨,每一個首先im在zend新,我需要一些幫助開始。Zend與表格
我的問題是我有一個登錄像這樣
<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>
和我的控制器是
代碼:選擇所有 公共職能在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);
}
}
和我型號
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();
}
我的問題是,當我嘗試登錄,網站顯示我沒有代碼的空白頁面,最新錯誤?我知道控制器和模型。
是你的login.phtml裏面的形式嗎?空白頁何時出現? – opHASnoNAME 2010-06-22 10:05:56