[thelist] php $_SESSION
Sven Göttner
sven at goettner.de
Wed Oct 16 17:05:01 CDT 2002
> if (!isset($_SESSION['SESSION_UNAME'] == $user)){
Hmm.
Well, your line is definitely wrong.
isset() only checks if a variable has a value at all.
<code>
if (isset($foo)) {
bar();
} else {
foobar();
}
</code>
But what you obviously try to do is check the VALUE of the variable,
not the existence of the VARIABLE itself.
Just do
<code>
if ($_SESSION['SESSION_UNAME'] != $user) {
foo();
}
</code>
More information about the thelist
mailing list