diff --git a/register.php b/register.php index cae93a3..b7067e4 100644 --- a/register.php +++ b/register.php @@ -40,17 +40,14 @@ if(isset($_POST['submit'])) { $query->bindParam(':password', $password); $query->execute(); $_POST['success'] = 1; - header("Location: /register.php"); + $_SESSION["user"] = $user->getID($con, $username); + header("Location: /home"); } else { $userexists = true; } } } -if(isset($_POST['success']) && $_POST['success'] == 1) { -$username = $_POST['username']; -$_SESSION["user"] = $user->getID($con, $username); -} $result = file_get_contents("https://useless-facts.sameerkumar.website/api"); $thefunfact = json_decode($result); ?>