prepare($sql); $stmt->bindParam(':username', $username, PDO::PARAM_STR); if ($stmt->execute()) { if ($stmt->rowCount() == 1) { $row = $stmt->fetch(); $id = $row['id']; $hashed_password = $row['password']; if (password_verify($password, $hashed_password)) { session_start(); $_SESSION["loggedin"] = true; $_SESSION["id"] = $id; $_SESSION["username"] = $username; header("location: index.php"); } else { $error = 'The password you entered was not valid.'; } } else { $error = 'No account found with that username.'; } } else { $error = "Oops! Something went wrong. Please try again later."; } } catch (PDOException $e) { $error = "Error: " . $e->getMessage(); } $conn = null; } } ?> Login - Pet Tinder

Login

" method="post" class="mt-4">

Don't have an account? Sign up now.