How can I add a salt to my current hash password when a user registers. And how should I store to my password in My MySQL database?
Here is my PHP code so far.
if ($_POST['password1'] == $_POST['password2']) {
$sha512 = hash('sha512', $_POST['password1']);
$password = mysqli_real_escape_string($mysqli, $purifier->purify(strip_tags($sha512)));
} else {
$password = NULL;
}