PHP User Account Redirect

#1

Hello there.
I am using a basic PHP user login system that stores the following information:
-Username
-Password (Hashed)
-Created At
-ID
The user system can be found here:
https://www.tutorialrepublic.com/php-tutorial/php-mysql-login-system.php

I would like to add a function so that when a user logs in successfully, it redirects them to a URL that is saved in the database for that user, and if one doesn’t exist, it redirects them to a page for all accounts across the board.

How would this be done?

Many Thanks.

#2

It would be done where they do this in the tutorial,

if(isset($_SESSION["loggedin"]) && $_SESSION["loggedin"] === true){
    header("location: welcome.php");
    exit;
}