Ich benutze PHP 7.1.6. Ich versuche, password_hash zu verwenden, aber es scheint nicht zu funktionieren. Hier ist mein Code:Password_hash nicht Hashing
$post = $this->input->post();
$maxid = $this->db->query('SELECT MAX(App_Users.ID) AS MAXID FROM App_Users')->row()->MAXID;
$maxid = $maxid + 1;
$hash = password_hash($post['Password'], PASSWORD_DEFAULT);
$this->db->query("INSERT INTO APP_USERS (ID, NAME, PASSWORD)
VALUES(".$maxid.", '".$post['Name']."', '". $hash ."')");
Das Passwort wird ohne Hashing gespeichert. $ post ['Passwort'] = '1234' und es wird in der DB als '1234' gespeichert.
Mache ich etwas falsch?
'$ post 'kommt von wo? –
Bitte, var_dump $ post – MorganFreeFarm
'$ hash' ist eine Zeichenkette, keine Ganzzahl - Edit: einmal' password_hash() 'tritt ein. –