|
Posted by luiheidsgoeroe on 04/06/07 07:51
On 5 apr, 19:28, "Paul" <l...@invalid.com> wrote:
> And it reference $user on the next page. Register_globals are set on the
> existing server but I am moving to a new server where it is not. The code
> of the next page is lilke:
>
> session_register('user');
> $user=$_SESSION['user'];
>
> I also want to turn it around so it's:
> $_SESSION['user'] = $user;
>
> But that fails - $user is empty. By the way, $user is an object.
>
> Any ideas to how to make sure:
> $_SESSION['user'] = $user;
>
> works on the second page?
Like Jerry said, drop the session_register(). Also, on the original
page you'd have to put the object in the session, not in the second
page. So:
First page:
$_SESSION['user'] = $user;
And then you can use it on the next page (if the object hasn't got
recursive/self-referencing qualities).
--
Rik
"Why break one foot if you've got two of them?"
[Back to original message]
|