Hi,
I am registering an array variable with the session to hold objects of a user defined class. I have 3 pages genereated by f1, f2 and f3 - the corresponding php files. I am doing a session_register($m_ses_array) in f1. In f2, this array is populated with objects.
When I try and access this arrray in f3 the problem I face is it is empty and does not have any elements.
i worked around this and passed the array as a parameter to the function handling it in f3 :
f3
<?
$temp = $m_ses_array;
$m_ses_htmlwriter->displayArrayVals($temp);
?>
This works fine but when I try and access the object methods inside the displayArrayVals( ) function :
function displayArrayVals($temp)
{
......
for($p=0;$p<count($temp);$p++)
{
// array contains objects of class DSTPUck
echo ("val for element $p is " . $temp[$p]->m_name);
}
.......
}
I get the following error:
Fatal error: The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition dstpuck of the object you are trying to operate on was
loaded before the session was started in /www/htdocs/rajiv/project/php/html/DSTPHTMLWriter.php on line 436
any help would be greatly appreciated. I have been struggling with this for a while now!
Rajiv