Login checker Functions
02 login functions that check if a user is logged in by checking is a session is equal to true that would have been set on login. If not logged in the redirect to login.php
function logged_in() {
if($_SESSION['authorized'] == true) {
return true;
} else {
return false;
}
}
function login_required() {
if(logged_in()) {
return true;
} else {
header('Location: login.php');
}
}