Re: Re: change value of session variable?
| From: | Justin Patrin | Date: | Thu, 22 Jul 2004 05:10:27 +0000 |
| Subject: | Re: Re: change value of session variable? | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-191474@lists.php.net to get a copy of this message | ||
On Wed, 21 Jul 2004 22:42:40 -0400, Five <primeooze@hotmail.com> wrote:
>
> "Chris Shiflett" <shiflett@php.net> wrote in message
> news:20040722004551.58529.qmail@web52804.mail.yahoo.com...
> > --- Five <primeooze@hotmail.com> wrote:
> > > That did it! I wonder if there is a way, then, to have it work even if
> > > the variable is initialized after it is echoed.
> >
> > You see, that makes no sense, and that's why no one else was able to
> > answer your question. Code is executed in order. Consider this:
> >
> > <?php
> > $foo = 'one';
> > echo $foo;
> > $foo = 'two';
> > ?>
> >
> > This script will output "one", and it should. :-)
> >
>
> My problem isn't the logic of when and where to output variable values. It's figuring
> out when a session variable will accept
> initialization and what enables and/or prevents it from doing so. I would like to be able to
> initialize a session variable on one
> page, call a second page, have the code on the second page process some information and
> reinitialize the session variable to another
> value so that new value could be available to be used on the first page. A lot like having a
> function return a value. The problem is
> that the session variable won't accept a new value just any old where in the code on the
> second page (apparently.)
>
As said in earlier posts, it should have worked as you originally had
it. What version of PHP are you using? It's possible that there's a
bug.
--
DB_DataObject_FormBuilder - The database at your fingertips
http://pear.php.net/package/DB_DataObject_FormBuilder
paperCrane --Justin Patrin--