ballinonabudget Posted May 28, 2009 Share Posted May 28, 2009 Forum Newbie Joined: Wed May 27, 2009 6:32 pm Posts: 1 I have a form page populated with javascript jump menus. I am trying to pass variables via a GET request into a SESSION variable to the same page so that I can keep my variables every time the page refreshes. Here is one jumpmenu field example: <select name="series1" onChange="MM_jumpMenu('parent',this,0)"> <?php while($series = mysql_fetch_array($series_result4)) { <OPTION value="rf-cable-assemblies-test.php?series1=<?php echo $series['series_abbreviation'];?>" ><?php echo $series['series_name'];?></OPTION> <?php } ?> </select> This is where I pass the GET requests to SESSION variables(scripted on the same page): $_SESSION['series1'] = $_GET['series1']; $_SESSION['series2'] = $_GET['series2']; Sessions seem to be working fine. The problem is I would like to store all of these SESSION variables(10 variables total) so that I can use them on the page.. However each time I select a new jump menu, the page refreshes and the SESSION variables get emptied except for whichever GET request I'm sending back to my page. Is there a better way to get these SESSION variables from these fields without using a GET request? Here is an older example of this form, using all GET requests and no sessions(I am working on a more simplified version on this new version on my local PC)..http://www.rfconnector.com/rf-cable-assemblies.php Link to comment https://forums.phpfreaks.com/topic/160043-solved-get-request-and-session-variables-not-working-together/ Share on other sites More sharing options...
ballinonabudget Posted May 28, 2009 Author Share Posted May 28, 2009 Solved the problem using this code... if((isset($_GET)) && !empty($_GET['series1'])) { $_SESSION['series1']=$_GET['series1']; } Searched through older threads and someone had a similar issue. Link to comment https://forums.phpfreaks.com/topic/160043-solved-get-request-and-session-variables-not-working-together/#findComment-844299 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.