Hi guys! I want to be able to access my session variables when I perform functions in my different classes. I'm able to recognize the variable, but the value I gave it is gone?
Can anybody help me?
Please!
Kristian
are you doing a session_start()? I only ask because that's what usually bites me.
Yes! That's what I can't get! To me everything seems to be OK!
If I try to access the variables from other *.php 's (Which are not classes) I'm able to get it out!
It seems like the class thing screws me up!
Thanks!
ok, are you trying to access the variables from within a function in the class?
Reemmber that you'll need to import the variables into the functions with either "global $var1, $var2;" at the beginning of the function, or accessing them directly with the $GLOBALS array ($GLOBALS["var1"])
HTH
glj
Yup, that's what I was getting to. 🙂
yess That's right!
ok, like Gareth said...
At the beginning of your function declaration are you using a global statement?
THANKS guys!
I think it's working now!
Sorry! Kind of rode in and stole your thunder there.
Apologies 🙂