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:
Code:
...
myObject = new MyClass();
...
in
fileB.php, I need to use the
myObject object created in fileA.php.
1. How would I do that?
Is the best way using sessions?
Code:
$_SESSION["my_object"] = myObject;
or are there better ways?
----------------------------------------
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?