unicatcher Posted July 28, 2006 Share Posted July 28, 2006 Hi all,I've got a problem with $_SESSION[].[i][b]Script entry[/b][/i]1. Read values from a mysql result to session[code]foreach($sql_result as $name=>$value){ $_SESSION[$name] = $value;}[/code]2. [i]Debug[/i]: Display all values in $_SESSION[code]foreach($_SESSION as $name=>$value){ print($name . " = " . $value . "<br>");}[/code]3. Display nth wizard form (8 forms in total).A wizard form is just a form containing part of the recordset I get from mysql in step 1.If you put all the forms next to eachother you've got a graphical representation of the table's layout.4. Save values on form submitWhenever a wizard form submits ('next') I catch all the fields like this:[code]foreach($_REQUEST as $name=>$value){ $_SESSION[$name] = $value; }[/code]Since the field names correspond with the table field names the values posted will overwrite the ones that I read from the database.5a. Display next wizard form -> step 25b. Write all values to mysql if no more wizard forms to display[i][b]Script end[/b][/i][b]Problem[/b]This script worked for about 2 months but now suddenly acts really strange.When I enable the debug part (display session contents & session adds) the following happens:Wizard 1:All variables are in $_sessionShow valid periods -> select + nextWizard 2:$_SESSION['period'] = new valueShow valid age categorie -> select + next (or previous)Wizard 3:$_SESSION['age'] = new value$_SESSION['period'] = [i][empty][/i]I checked the following:- I'm not making the '=' instead of '=='- Other variables show the same beheavior, but only 3 out of 8- The only time the script writes to the $_SESSION var's is by catching the $_REQUEST var's- The rest of the script only reads from the var's eg: $query="SELECT .... WHERE period=".$_SESSION['period']My system admin says it has got nothing to do with the server.I can't recall that I made changes, other then sql query changes to this file since it was put in production.Any ideas? Quote Link to comment https://forums.phpfreaks.com/topic/15884-session-behaving-strange/ Share on other sites More sharing options...
ToonMariner Posted July 28, 2006 Share Posted July 28, 2006 Not really...Stab in the dark seems as it appears you are using oop stuff - has the php engine been upgraded? Quote Link to comment https://forums.phpfreaks.com/topic/15884-session-behaving-strange/#findComment-65170 Share on other sites More sharing options...
Ninjakreborn Posted July 28, 2006 Share Posted July 28, 2006 what php version do you have. Quote Link to comment https://forums.phpfreaks.com/topic/15884-session-behaving-strange/#findComment-65172 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.