RE: [PHP] Session

From: Date: Thu, 15 Nov 2001 08:37:41 +0000
Subject: RE: [PHP] Session
Groups: php.general 
Request: Send a blank email to php-general+get-74688@lists.php.net to get a copy of this message
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 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

« previous php.general (#74688) next »