kev wood Posted October 23, 2008 Share Posted October 23, 2008 i am trying to use session variables to register variables taken from a form. i have never used session variables before so i am a bit unsure if i am registering the variables in the correct way. here is my code up to now <?php session_start(); $_SESSION["dropdown"]; $_SESSION["radio"]; $_SESSION["dropdown2"]; $_SESSION["radio2"]; ?> i have 2 different forms on the page which go to different pages depending on the user choice. i am unsure if this will register the variables i need. i have a drop down list which is called 'dropdown' and i would like to know if what i have here will store the user choice in the session variable 'dropdown'. to retrieve the variables whhich i have not started to do yet would the code on the next page be something like this <?php session_start(); $_SESSION["dropdown"] = $db; $_SESSION["radio"] = $table; $_SESSION["dropdown2"] = $db2; $_SESSION["radio2"] = $table2; ?> with this code i could then use $db through the next page of code to get the value of the session variable 'dropdown' Link to comment https://forums.phpfreaks.com/topic/129732-solved-session-variables-and-forms/ Share on other sites More sharing options...
kev wood Posted October 23, 2008 Author Share Posted October 23, 2008 sorted. Link to comment https://forums.phpfreaks.com/topic/129732-solved-session-variables-and-forms/#findComment-672661 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.