PHP Sessions

theopfor

In Runtime
Messages
173
Location
Right behind you
I try to check if a session stored variable isn't there to determine whether or not a user is logged in, but I get an error about the variable not existing, so I have no idea how to accomplish this without giving the user an error about a variable.

The code is similar to:

Code:
if (!$_SESSION['loggedin'])
and I have tried:
Code:
if ($_SESSION['loggedin'] == NULL)
 
Thanks! It worked.

EDIT: Gosh I had this one time before, but, I get errors when including something from a previous directory. I added a .. before the path of what I wanted to include, which worked, but then stuff that was included, within the include, had errors, which I fixed. So then I went back to my index.php file, and then I get tons of errors for including stuff.
 
Thanks! It worked.

Great.

EDIT: Gosh I had this one time before, but, I get errors when including something from a previous directory. I added a .. before the path of what I wanted to include, which worked, but then stuff that was included, within the include, had errors, which I fixed. So then I went back to my index.php file, and then I get tons of errors for including stuff.

Huh?
 
It's hard to explain. I have stuff in various folders, usually parts of webpages that I include with the include() function. I a folder called "login" I need to access stuff from a folder called "include." The include folder is in the same directory as login, so I use
"../include/something.php" (something like that), but then it breaks a bunch of stuff in the pages that aren't in folders. How can I go to /var/www without using ".."?
 
Back
Top Bottom