0) { while($row = mysqli_fetch_assoc($userdata)) { $dbuser_id = $row['user_id']; $dbusername = $row['username']; $dbemail = $row['email']; $dbpassword_hashed = $row['password']; } if (password_verify($password, $dbpassword_hashed)) { $_SESSION['loggedin'] = true; $_SESSION['user_id'] = $dbuser_id; $_SESSION['username'] = $dbusername; $_SESSION['email'] = $dbemail; header("Location: index.php"); mysqli_close($conn); } else { $passwordErr = "Неправильный пароль"; } } else { $emailErr = "Почта не зарегестрирована"; } } ?>