I am pretty new to development and MVC. I want to use session to store my data in a multi page survey, (using next and back buttons to save in the last page). Most of the topics for sessions are about login infos. Can any one help me please.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
You have to use $_SESSION['YOUR KEY'] = "ANY VALUE"; try this above code it might be help you have to use $_SESSION instead of SESSION.
<input type="radio" value="1" <?php if($_SESSION['YOUR_KEY'] == 1) { echo "selected";} ?> >
<input type="radio" value="2" <?php if($_SESSION['YOUR_KEY'] == 2) { echo "selected";} ?> >
Add the if condition in input radio