"Christian Dechery" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> How do I store (and update) an array within a session...
>
> Like I'd have
>
> <?php
> session_start();
> $time["page1"]="20";
>
> //here, should I do this?
> session_register("time["page1"]");
>
> //or this?
> session_register("time");
It should work with this.
FYI. If you set register globals off and enable track vars on in your php.ini.
(It may work with other settings, but this is what I use)You don't even have to
write
$var = "session var";
session_register("var");
session_unregister("var");
Instead, you can write
$HTTP_SESSION_VARS['var'] = "value you want to store in session";
unset($HTTP_SESSION_VARS['var']); // to unregister from session
>
> ?>
>
> cuz I'll have more pages...
> $time["page20"]="300";
>
> is this going to automatically load into the session vars or I have to do
> something first?
No.
When I learn new languages, I usually write a lot of simple codes to make sure I
correctly understands how it works. I suggest to do that.
Regards,
--
Yasuo Ohgaki
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]