I have a function logged_in()
whose purpose is to check if the user is logged in. This function, located inside users.php
, is called from login.php
.
Everytime I attempt to call this function I get the following error
Call to undefined function logged_in() in line 67
Here's my code
users.php
function logged_in() //line 67
{
return (isset($_SESSION['user_id'])) ? true : false;
}
login.php
if(logged_in()===true)
{
include 'includes/widgets/loggedin.php';
}
else{
include 'includes/widgets/login.php';
}
What seems to be the issue?