Page 1 of 1

[SOLVED] Using Sessions in Included Pages

Posted: Thu Jul 29, 2004 8:15 pm
by sk8erh4x0r
I'm having trouble right now. First off, on every page of my website I include navigation.php. On navigation.php i'm trying to use an UPDATE query that involves a session. My query does work, but not in an include. I tried a simple code snippet to check if I could even use sessions in an include by doing this:

Code: Select all

<?php
if(!$_SESSION['user'])
{
echo "That's not good";
}
else
{
echo "Whew";
}
?>
Once I logged in, it said "That's not good" even though the session IS set. Am I just doing something wrong or can you not use sessions on a page thats included in general?[/php_man]

Posted: Thu Jul 29, 2004 10:19 pm
by d3ad1ysp0rk
[php_man]isset[/php_man]
[php_man]empty[/php_man]

Check them out. :)