Hey,
Perhaps you guys can help me. I am getting this error:
Parse error: syntax error, unexpected 'DEFINE' (T_STRING), expecting function (T_FUNCTION) in
with this code:
public function validatePassword($password, $username){
return $this->hashPassword($password, $username) === $this->password;
}
/**
* @return hashed value
*/
DEFINE('SALT_LENGTH', 10);
public function hashPassword($phrase, $salt=null){
$key = 'Gf;B&yXL|beJUf-K*PPiU{wf|@9K9j5?d+YW}?VAZOS%e2c -:11ii<}ZM?PO!96';
if($salt == '')
$salt = substr(hash('sha512', $key), 0, SALT_LENGTH);
else
$salt = substr($salt, 0, SALT_LENGTH);
return hash('sha512', $salt . $key . $phrase);
}
Any ideas how to fix this?