I have a confusion because this is not what I usually do.
Suppose I have 2 php files: fileA.php, and fileB.php
And I have 1 class file: myClassFile.php
in fileA.php, I need to instantiate a MyClass class:
in fileB.php, I need to use the myObject object created in fileA.php.Code:... myObject = new MyClass(); ...
1. How would I do that?
Is the best way using sessions?
or are there better ways?Code:$_SESSION["my_object"] = myObject;
----------------------------------------
2. Suppose I don't use solutions similar to the above.. Will myObject in fileA.php be lost (destroyed, or freed) when the user proceeds to fileB.php? That is, will there be no more reference to myObject in fileB.php?




Reply With Quote
... its been used already by 3 websites
