diff --git a/login.php b/login.php new file mode 100644 index 0000000..f2bc12a --- /dev/null +++ b/login.php @@ -0,0 +1,67 @@ +real_escape_string($_POST["email"])); + + $result = $mysqli->query($sql); + + $user = $result->fetch_assoc(); + + if ($user) { + + if (password_verify($_POST["password"], $user["password_hash"])) { + + session_start(); + + session_regenerate_id(); + + $_SESSION["user_id"] = $user["id"]; + + header("Location: index.php"); + exit; + } + } + + $is_invalid = true; +} + +?> + + + +
+