例如,我将如何获取单选按钮的值并在我的会话中使用它;
<input type="radio" name="minor" id="minor" group="underage" class="minor_yes" value="yes" />Yes<br />
<input type="radio" name="minor" id="minor" group="underage" class="minor_no" value="no" />No<br />
<div class="underage <?= isset($_SESSION['minor']) ? "style=\"display: block;\"" : "style=display: none;\"" ?>">
<label>Guardian 1</label>
<input type="text" name="guardian1" id="guardian1" value="<?php echo stickyText('guardian1');?>" />
<label>Guardian 2</label>
<input type="text" name="guardian2" id="guardian2" value="<?php echo stickyText('guardian2');?>" />
</div>
如您所见,代码将名称称为“次要”,但即使选择否,它仍会显示 div,无论值如何,我都需要将值传递给我的 isset($_Session['minor']) 参数,这将如何实现?