Re: session_register()

From: Date: Wed, 05 Jul 2000 16:23:21 +0000
Subject: Re: session_register()
Groups: php.general 
Request: Send a blank email to php-general+get-4993@lists.php.net to get a copy of this message
>I have a question about this function. It isn't specifically stated in the >documentation that I can find, but the examples kinda show this but I want >to make sure.... > >Do you call session_register("variable") before or after actually setting >the variable? > >I would think that logically, you set the variable's value then register it: > >$variable = "this is my string"; >session_register("variable"); > >But it seems that the examples do it the other way around: > >session_register("variable"); >$variable = "this is my string"; > >If this is the case. Then how do you get past the issue where once the >variable is registered it can't be changed? If the variable is registered >with the function I would think it registers at that moment with blank >information or do all the variables get written when the script ends? > Registering a variable does not save the value of the variable at the time it is registered. Instead, you can think of registering as adding the variable's name to a list of variables to be saved at the *end* of the script. >Then, in addition, what if you create a session, register variables in it, >then later on want to add more variables to the same session. Do you simply >just start registering again and they will fit right in? >-- Yes. > >Thomas Deliduka >IT Manager > ------------------------- >New Eve Media >The Solution To Your Internet Angst >http://www.neweve.com/ > > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net >For additional commands, e-mail: php-general-help@lists.php.net >To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.general (#4993) next »