Re: Re: session-problem
| From: | Juerg Zgraggen | Date: | Mon, 01 Sep 2003 23:50:32 +0000 |
| Subject: | Re: Re: session-problem | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-161401@lists.php.net to get a copy of this message | ||
:-) cool thank you!
is any "$_"-variable superglobal? $_REQUEST, $_POST, ...?
cheers,
jazper
"Curt Zirzow" <php-general@zirzow.dyndns.org> schrieb im Newsbeitrag
news:20030901225559.GR16462@bagend.shire...
> * Thus wrote Juerg Zgraggen (j.a.z@bluewin.ch):
> > Probably i got the problem... but i don't know how to solve it!!!
> >
> > i include one of my class.
> > in the constructor of this class i did a global...
> > global $_SESSION;
> >
> > as soon as i delete that line. my script works perfect...
> >
> > is this not allowed anymore... to access $_SESSION in a constructor??
>
> $_SESSION is a superglobal meaning you don't need to and shouldn't
> (as you found out the hard way :) global it. You can access it
> anytime:
>
> class foo {
> function foo {
> $this->var = $_SESSION['var'];
> }
> }
>
> Curt
> --
> "I used to think I was indecisive, but now I'm not so sure."