기본 로그인 시스템을 구현하려고합니다.정의되지 않은 메소드 호출 Bcrypt :: check_password() - CodeIgniter
사용자 암호는 bcrypt에 의해 해시되고 데이터베이스에 저장됩니다.
로그인 모델에서 db에서 해시 된 비밀번호를 가져 와서 사용자가 bcrypt check password를 사용하여 입력 한 것과 일치 시키려고합니다.
function login($data)
{
$hashedpass = "";
$query=$this->db->get_where('voyagers', ['EMAIL'=>$data["EMAIL"]]);
$result=$query->result();
foreach($result as $val) {
$
$hashedpass = $val->PASSWORD;
}
if ($this->bcrypt->check_password($data["PASSWORD"], $hashedpass)) {
return $result;
}
else
return 0;
}
오류가 발생하면 내 프로젝트를 실행 모델 : 도움을
A PHP Error was encountered
Severity: Error
Message: Call to undefined method Bcrypt::check_password()
Filename: models/Model_Main.php
Line Number: 47
Backtrace:
감사합니다.
암호를 만드는데 사용하지 않는 이유는 무엇입니까? http://php.net/manual/en/function.password-hash.php 매우 simular http://php.net/manual/en/function.password-hash.php # refsect1-function.password-hash-examples and http://php.net/manual/en/function.password-verify.php – user4419336
참고 : CI를 사용하는 경우 파일 이름과 클래스의 첫 문자는 대문자 여야합니다 3 이상은 http://www.codeigniter.com/user_guide/general/styleguide.html#file-naming – user4419336
여기에 설명되어 있습니다 ** NOT ** me @DKR – user4419336