Click to See Complete Forum and Search --> : [RESOLVED] Show if Admin Logged In


cinematic_jesi
02-29-2008, 09:56 AM
Okay I can't figure out what I'm doing wrong here..

I have 2 access levels 0 & 1
0 = administrator
1 = regular userI have it so, when a user is not logged in it shows the login form, and when they are logged in it shows them options.

if ($_SESSION['MM_UserGroup'] > "") {
print $loggedin;
}
else {
print $loginform;
}
So then.. in a seperate location.. i wanted a link to the administration panel to show when an administrator was logged on...

So I tried this:


if ($_SESSION['MM_UserGroup'] = "0") {
echo "[admin panel]";
}
else {
echo "";
}

But.. it just echoes out the text [admin panel] regardless if a user is even logged in or not?

Thanks =]

MrCoder
02-29-2008, 10:12 AM
if ($_SESSION['MM_UserGroup'] != "")

if ($_SESSION['MM_UserGroup'] == "0")


// Use "=" to assign a value
$a = "foo";
$b = "bar";
$a = $b; // $a is now "bar"

// Use "==" to compare a value
$a = "foo";
$b = "bar";
if($a == "foo") // True

cinematic_jesi
02-29-2008, 10:55 AM
Dang it! Why is it always the simple stuff??? GRR! Stupid == lol.

Anyhoo -- Thanks Much!! =]