<?php

function redirect_to($new_location){
    header("Location: ". $new_location);
    exit;
}
function confirm_login()
{
    if (isset($_SESSION['user_id'])) {
        return true;
    } else {
        $_SESSION['errorMsg'] = "Kindly Login to continue!";
        redirect_to("login.php");
    }
}
confirm_login();
?>
