Answer the question
In order to leave comments, you need to log in
How to use the session in php to save the value of the selected radio?
<input type="radio" name="one" value="$i" id="radio" <?php if($_SESSION['i']==$i) { ?> checked="checked" <?php } ?> >
Answer the question
In order to leave comments, you need to log in
<input type="radio" name="sex" value="male">Male<br>
<input type="radio" name="sex"
<?php (isset($_SESSION['i'])&&$_SESSION['i'])==$i?'checked="checked"':''?>
value="female">Female
And what for in session to store, would not be better in cookie or localStorage?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question