Re: Updating Sessions

From: Date: Fri, 13 Apr 2001 20:56:03 +0000
Subject: Re: Updating Sessions
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-48484@lists.php.net to get a copy of this message
In article <01041321314700.01991@localhost>, jord.elver@virginnet.co.uk (Jordan Elver) wrote: > Hi, > I've got a multi page form and I'm using sessions to keep track of all the > variables between the pages. SO I fill in page one of the form and add the > variables to a session. Then I can go on completeing the rest etc. > > My problem is that I want my users to be able to go back to the pages they > have already visited and edit the data (in the form) and then undate the > variables in the session. But I can't update the session, so I thought if I > called session_unregister and then session_register again then that would > work, but it doesn't? Just change the variable's value. For instance: //$sess_var="old_val" if($update==TRUE) { $sess_var="new_val"; echo $sess_var //"new_val" } else { echo $sess_var //"old_val" } -- CC

« previous php.general (#48484) next »