I believe you should only register a session variable after you have populated it. And also when you are registering a session variable you only use the name of the variable and exclude the "$".
like this:
$var = "hello";
session_register("var");
good luck
dgarrivier wrote:
Hye Folks,
I have a strange problem with session variables.
I am running PHP 4.0.6 under FreeBSD 4.4
I have a large array of data and I use a session variable to store this array and do some controlled scrolling in the data.
I do:
session_start();
if(session_is_registered("my_var"))
{
/ A post (21/08/2002) explained that you to have to use this, even if the var is registered /
session_register($my_var);
}
else
{
session_register($my_var);
// Fill the array
$my_var->fill_array();
}
$my_var->show_the_array();
Apparently this code wotks fine the first time you encounter the variable and fill the array. The session file is created (in /tmp) BUT, I can not retrieve the data in the session variable. I get an empty page.
Apparently, all file rights are correct (/tmp is 777) ...
Does anyone have an idea ?