我想比较输入“传递”与数据库中的“传球”。如果匹配,用户将进入注册表单。相同的密码值比较返回false cakephp
即使两个密码的值相同,但我仍然得到'密码不正确'的错误结果,并且提示:Undifined index:pass。 我使用CakePHP 2.8
这是我现在的代码:
public function checkCodeRespondent() {
$password = $this->data['Respondent']['pass'];
if (isset($password) && !empty($password))
{
$respondent = $this->findByPass($password);
debug($respondent);
if ($this->data['Respondent']['pass'] != $respondent['pass']) {
print 'password is not correct';
} else {
print 'password is correct';
}
}
这是从数据库
public function findByPass($pass) {
$respondent = $this->Respondent->find('first', array('conditions' => array('pass' => $pass)));
return $respondent;
}
没有两个都没有散列。 – user2314339