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 . ]);
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
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;
-
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
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
5 matches
Mail list logo