Session Variable

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
denimderek
Forum Newbie
Posts: 7
Joined: Fri May 30, 2003 8:59 pm
Location: Corona, CA

Session Variable

Post by denimderek »

Hopefully I don't come off sounding tooooo ignorant, but is there any reason I wouldn't be able to get a session variable to work inside of a function? I've tried making this variable a global variable, thinking that would pass the value to the function, but thats still not working. And I know that this server DOES have register_globals = On. Any ideas? Must I declare this variable as a global variable from within or outside of the function? The function is actually being called from an include("functions.php"); reference.
denimderek
Forum Newbie
Posts: 7
Joined: Fri May 30, 2003 8:59 pm
Location: Corona, CA

Post by denimderek »

Nevermind! I'm lame, I got it. I had to use global $user_id; within the function, not outside of it.
Post Reply