Accessing Session Vars from Included Function
Posted: Fri Apr 20, 2007 6:46 pm
Hi,
I created a function (myfunction()) in a function page (functionspage.php) that is included in my main page (main.php). I call myfunction() from main.php and in myfunction() I'm trying to access one of my session variables but I can't. At the top of both functionspage.php and main.php I start the session (session_start()). Is there a way for myfunction() to access the session variables or do I need to pass it the session variable when I call it from main.php? Thank you very much for any help.
I created a function (myfunction()) in a function page (functionspage.php) that is included in my main page (main.php). I call myfunction() from main.php and in myfunction() I'm trying to access one of my session variables but I can't. At the top of both functionspage.php and main.php I start the session (session_start()). Is there a way for myfunction() to access the session variables or do I need to pass it the session variable when I call it from main.php? Thank you very much for any help.