自己做了个登陆注册的小东西 但一旦用字母登陆就报错
先上代码
这是控制器下登陆Action的代码
<br /> //登陆提交控制器<br /> public function logAction()<br /> {<br /> //获取登录表单参数<br /> $userid = $this->getRequest()->getParam('userid');<br /> $password = $this->getRequest()->getParam('psd');<br /> //创建表模型并查询登录密码<br /> $table = new user();<br /> $where = 'userid ='.$userid;<br /> $row = $table->fetchRow($where)->toArray();<br /> //验证表单密码和数据库密码<br /> if($row['password'] == $password)<br /> {<br /> //创建全局变量session用户名id<br /> session_start();<br /> $_SESSION['userid'] = $userid;<br /> //显示登陆成功视图<br /> $this->render('logok');<br /> }<br /> else <br /> {<br /> //密码错误显示登录失败视图<br /> $this->render('logfailed');<br /> } <br /> }<br />