According to the PHP book I have been reading, you register session variables by doing:
$foo = "foo value";
Then, supposedly I can start another page:
This does not work for me at all. On the first page $foo has a value, but it does not on the second page. I look at the session file and the foo is there but it has a value of null (N).
Now, I can use
$_SESSION[foo] = "foo value";
on the first page and then access
on the second with no problems.
I actually have a couple of questions:
1) Should the initial way work? If so, why is mine not working. Does it have anything to do with register_globals being turned off?
2) Which way is the more acceptable (better coding) way?