Re: Browser Redirect
| From: | Jim Lucas | Date: | Thu, 24 Apr 2003 16:34:36 +0000 |
| Subject: | Re: Browser Redirect | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-145180@lists.php.net to get a copy of this message | ||
this is because the value of the session variable is not saved to the
session array until the script stops running.
Jim Lucas
----- Original Message -----
From: "Chris Cook" <cjc1800@hotmail.com>
To: <php-general@lists.php.net>
Sent: Tuesday, April 22, 2003 5:49 PM
Subject: RE: [PHP] Browser Redirect
> Thanks for the reply. I have the code just like you have it, but on the
page
> that I register the session var, it is empty.
>
> //page1.php
> session_start();
> $_SESSION['var'] = 'value';
> echo $_SESSION['var']//results in nothing
>
> //page2.php or any other page.
> session_start();
> echo $_SESSION['var']//results in the correct value
>
> Thanks,
> Chris
>
> >From: "John W. Holmes" <holmes072000@charter.net>
> >Reply-To: <holmes072000@charter.net>
> >To: "'Chris Cook'"
> ><cjc1800@hotmail.com>,<php-general@lists.php.net>
> >Subject: RE: [PHP] Browser Redirect
> >Date: Tue, 22 Apr 2003 20:31:40 -0400
> >
> > > Is there another way to do a page redirect other than in the header. I
> > > want
> > > to register a session variable and then redirect the page so I can use
> > > that
> > > session variable immediately.
> >
> >Why do you have to redirect?
> >
> >Session_start();
> >$_SESSION['var'] = 'value';
> >
> >Now use $_SESSION['var'] wherever you need it.
> >
> >---John W. Holmes...
> >
> >PHP Architect - A monthly magazine for PHP Professionals. Get your copy
> >today. http://www.phparch.com/
> >
> >
>
>
> _________________________________________________________________
> Add photos to your messages with MSN 8. Get 2 months FREE*.
> http://join.msn.com/?page=features/featuredemail
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>