I am a newbie to Moodle. I have installed Moodle 4.0 on Ubuntu and am using the Moove theme
I'd like to check if the user is logged into Moodle in an external PHP script which is in a subdirectory of my Moodle installation.
My code is below
require_once('../config.php');
if (!isloggedin()) {
echo "not logged in<br>";
} else {
echo "logged in<br>";
}
This redirects me to my site home page as soon as the require_once('../config.php'); is reached.
Please can someone tell me how I can change this behaviour?