Is procedural PHP a good approach for user registration and login system good for begginers?
loginaction.php:
query($sql);
$result = $result->fetch_assoc();
if($result != null && password_verify($password, $result["password"])){
unset($result["password"]);
$_SESSION["user"] = $result;
header("Location: user.php");
}
}
and here is my registeraction.php:
query($sql);
if(mysqli_num_rows($check) > 0){
echo "Jste již registrovaný na tento Email";
exit();
}
$sql = "INSERT INTO user (name, surname, email, password) VALUES ('$name', '$surname', '$email', '$hashedPassword')";
$result = $conn->query($sql);
header("Location: login.php");
}
is this the good way to approach the login and register? Its not for a big app, just my testing. How could I improve my skills more and what is the best way possible if I want to start making proffesional websites