First thing I want is a member bar, If you are logged in it says welcome user otherwise it will say Not Logged In.
So, I made a page to simulate a login
CODE
<?php
$_SESSION = array();
session_destroy();
session_start();
$_SESSION['AUTH'] = "user";
$_SESSION['USR'] = "Michael";
header("Location: template.php");
?>
$_SESSION = array();
session_destroy();
session_start();
$_SESSION['AUTH'] = "user";
$_SESSION['USR'] = "Michael";
header("Location: template.php");
?>
Main Page
CODE
<?php
include('config_global.php');
$AUTHORISED = 'cheese';
if ($_SESSION['AUTH'] == "user") {
$AUTHORISED = "user";
$MEMBER = $_SESSION['USR'];
}
else {
$AUTHORISED = "[No Authorisation]";
$MEMBER = "Guest";
}
?>
include('config_global.php');
$AUTHORISED = 'cheese';
if ($_SESSION['AUTH'] == "user") {
$AUTHORISED = "user";
$MEMBER = $_SESSION['USR'];
}
else {
$AUTHORISED = "[No Authorisation]";
$MEMBER = "Guest";
}
?>
THEN IN MEMBER BAR
CODE
<?php if ($AUTHORISED == "user") {
echo 'Welcome to Publisher Plus Article Management System <b>' . $MEMBER . '</b> (User CP)' . $AUTHORISED;
}
else echo 'Not logged in ' . $AUTHORISED; ?>
echo 'Welcome to Publisher Plus Article Management System <b>' . $MEMBER . '</b> (User CP)' . $AUTHORISED;
}
else echo 'Not logged in ' . $AUTHORISED; ?>
Could someone please help me with this. I did get it to work once, with some code changes (I removed one of the = signs somewhere leaving only a single =, then I made a logout simulator to destroy the session, but it still said I was logged in.
Thanks alot!
