RE: [PHP] Re: Help with a trivial session example.
| From: | John Holmes | Date: | Thu, 30 May 2002 23:53:28 +0000 |
| Subject: | RE: [PHP] Re: Help with a trivial session example. | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-100025@lists.php.net to get a copy of this message | ||
You have to use session_register() with 4.0.6
---John Holmes...
> -----Original Message-----
> From: Daevid Vincent [mailto:daevid@daevid.com]
> Sent: Thursday, May 30, 2002 7:46 PM
> To: php-general@lists.php.net
> Cc: 'Michael Davey'
> Subject: RE: [PHP] Re: Help with a trivial session example.
>
> > I can't say that I have moved over to the new superglobals
> > yet - I prefer register_globals cos I am lazy ;)
>
> Given $myvar = 5;
>
> If you use session_register('myvar');
>
> Then on another page, do you just access it via $myvar?
>
> And if that's the case, isn't it the same to set
>
> $HTTP_SESSION_VARS['myvar'] = $myvar;
> Or even
> $GLOBALS['myvar'] = $myvar;
> Or
> $_SESSION['myvar'] = $myvar;
>
> Not that ANY of these are working for me *sigh*
>
> > But it does seem that there are two possible variables that
> > you need to use - the one in your script
> > ($HTTP_SESSION_VARS), but this is only for 4.0.6 or less, it
> > is $_SESSION otherwise - what version do you have installed?
>
> 4.0.6 according to the phpinfo link on the page ;-)
>
> > I made a very simple test page, and even that doesn't work:
> >
> > http://daevid.com/examples/index.phtml
> >
> > Notice how I have the right session_id, but the variable didn't pass
> > onto the second page.
> >
> > Can someone please explain to me what I am doing wrong?
> > Do I not have PHP.ini configured properly or something?
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php