[thelist] php $_SESSION

R.Livsey R.Livsey at cache-22.co.uk
Wed Oct 16 17:55:01 CDT 2002


> quoth Gary Bland:
> > if (!isset($_SESSION['SESSION_UNAME'] == $user)){
>
> isset() (actuallly a PHP language construct, not a function)
> requires a variable as an argument, not an expression. I
> don't really get that line of code, though... Shouldn't it just be:
>
> if ($_SESSION['SESSION_UNAME'] != $user) {
>
> It could be that you accidentally deleted a portion of that
> line, too. I know I did that a couple times when I was
> learning how to use vim ;)
>
> If/when in doubt: <http://php.net/isset>.
>
> --
> shawn allen

Hmmm are you trying to say, if session_uname isnt set, and if it is set
that it doesn't equal $user?

If so, then this should work for that.

if (!isset($_SESSION['SESSION_UNAME']) || $_SESSION['SESSION_UNAME'] !=
$user))
{
	...
}

R.Livsey
Incutio Web Developer
[ PHP | Perl | mySQL | Java ]
w : www.cache-22.co.uk
e : R.Livsey at cache-22.co.uk
  / Richard at incutio.com




More information about the thelist mailing list