[PHP] Sessions in classes dosn't work!?

2001-08-30 Thread Thomas Watson
How come that I cannot store a varible in the session when I do this from within another object? This is my code: ?php session_start(); class MyClass { function MyClass($state) { if($state == page2) { print([ . $foo . ]);

Re: [PHP] Sessions in classes dosn't work!?

2001-08-30 Thread Andrey Hristov
30, 2001 12:10 PM Subject: [PHP] Sessions in classes dosn't work!? How come that I cannot store a varible in the session when I do this from within another object? This is my code: ?php session_start(); class MyClass { function

Re: [PHP] Sessions in classes dosn't work!?

2001-08-30 Thread Thomas Watson
This is because $foo is local to the member functions of the class. declare global $foo at the start of every function. Ok thnx... it worked... but how do you then explain this?: *** ?php class TestClass { var $foo;

Re: [PHP] Sessions in classes dosn't work!?

2001-08-30 Thread Andrey Hristov
- From: Thomas Watson [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, August 30, 2001 2:18 PM Subject: Re: [PHP] Sessions in classes dosn't work!? This is because $foo is local to the member functions of the class. declare global $foo at the start of every function. Ok thnx

Re: [PHP] Sessions in classes dosn't work!?

2001-08-30 Thread Thomas Watson
Hmmm, it seems that obj is not saved to the session file. I don't thik that before new is needed. This is weird :) It worked when I removed the (thought that I tried that ;). Now I just can't remember why I put it there in the first place. I hope it wasn't importent ... well I will