Session to store temporary data in MVC [closed]

2019-09-20 00:57发布

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条回答
叼着烟拽天下
2楼-- · 2019-09-20 01:35

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

查看更多
登录 后发表回答