RE: [PHP] Session

From: Date: Thu, 15 Nov 2001 16:57:59 +0000
Subject: RE: [PHP] Session
Groups: php.general 
Request: Send a blank email to php-general+get-74745@lists.php.net to get a copy of this message
Yep, 'variables_order'. -----Original Message----- From: George Whiffen [mailto:george@intellnet.net.uk] Sent: 15 November 2001 06:30 To: php-general@lists.php.net Subject: Re: [PHP] Session For the record: You can control the order of precedence of variable reading through a php.ini setting, variable_order, (replaces gpc_order). I believe the default is EGPCS i.e. environment, get, post, cookie, session. The last in the list takes precedence, i.e. session variables normally have precedence over get/post variables George Rudolf Visagie wrote: > > The problem lies with the fact that you have a variable 'name' that gets > posted in the form as well as a session variable 'name' that is passed to > the script when it is executed again. As far as I remember the session > variable supercedes the posted variable, so the session variable would > overwrite the value of the posted variable every time. You need to register > the session variable with another name and then toggle between the two > variables in you script. > > Also, a session variable need only be registered once: > if (!session_is_registered("name")) { > session_register("name"); > } > > Rudolf Visagie > Principal Software Developer > Digital Healthcare Solutions > Tel. +27(0)11 266 6946 > Fax. +27(0)11 266 5080 > Cell: +27(0)82 895 1598 > E-mail: rudolf@dhsolutions.co.za > > -----Original Message----- > From: jtjohnston [mailto:taylorjo@collegesherbrooke.qc.ca] > Sent: 15 November 2001 09:08 > To: php-general@lists.php.net > Subject: [PHP] Session > > Hi, > > I have read: http://www.php.net/manual/en/function.session-register.phpÍD > �ù¥»TŒXÍ­v¬ > > Could I ask you a question about how to set a session $vars in a <FORM>? > It seems to be quite a mystery/controversy!! > > This is my problem: > http://www.collegesherbrooke.qc.ca/languesmodernes/postcard/test_session.php > > Type something. > Press submit. > Change your text and re-submit. > > $name doesn't re-save itself. This is my code: > http://www.collegesherbrooke.qc.ca/languesmodernes/postcard/test_session.php > s > > Would you have any suggestions? > It can't be that complicated can it? > > J.T-Johnston > > -- > 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 -- 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 (#74745) next »