Re: Re: change value of session variable?
| From: | Five | Date: | Thu, 22 Jul 2004 02:42:40 +0000 |
| Subject: | Re: Re: change value of session variable? | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-191462@lists.php.net to get a copy of this message | ||
"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.)