[SOLVED] Using Sessions in Included Pages

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
sk8erh4x0r
Forum Commoner
Posts: 43
Joined: Wed May 26, 2004 8:27 pm

[SOLVED] Using Sessions in Included Pages

Post 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]
Last edited by sk8erh4x0r on Wed Aug 11, 2004 4:57 pm, edited 1 time in total.
d3ad1ysp0rk
Forum Donator
Posts: 1661
Joined: Mon Oct 20, 2003 8:31 pm
Location: Maine, USA

Post by d3ad1ysp0rk »

[php_man]isset[/php_man]
[php_man]empty[/php_man]

Check them out. :)
Post Reply