I have a logout function in a functions file
function logout2(){
$logoutAction = $_SERVER['PHP_SELF']."?doLogout=true";
if ((isset($_SERVER['QUERY_STRING'])) && ($_SERVER['QUERY_STRING'] != "")){
$logoutAction .="&". htmlentities($_SERVER['QUERY_STRING']);
}
if ((isset($_GET['doLogout'])) &&($_GET['doLogout']=="true")){
//to fully log out a visitor we need to clear the session varialbles
$_SESSION['MM_Username'] = NULL;
$_SESSION['MM_UserGroup'] = NULL;
$_SESSION['PrevUrl'] = NULL;
unset($_SESSION['MM_Username']);
unset($_SESSION['MM_UserGroup']);
unset($_SESSION['PrevUrl']);
$logoutGoTo = "logout.php";
if ($logoutGoTo) {
header("Location: $logoutGoTo");
exit;
}
}
}
I have a file that includes the functions file
require_once('includes/functions.php');
When I call the function on the page
logout2();
I get the following error message -
You don't have permission to access /tutor/<br /><b>Notice</b>: Undefined variable: logoutAction in <b>C:/www/server/public/tutor/softwarelist1.php</b> on line <b>62</b><br /> on this server.
Can someone please tell me why I am receiving this error.