我正在用表单传递页面中单选按钮的值,并且我想在另一个php文件中获取所选选项的值,但是我无法获取该值。
第一页:
<form class="itemSelection" action="../php/itemSelection1Save.php"><br><br>
<h1>Recommended Item(s)</h1>
<table class="itemTableRecom">
<thead>
<tr>
<th>Selected Item Type</th>
<th>Recommended Item Type</th>
</tr>
</thead>
<tbody>
<?php
foreach ($_SESSION['itemsInfo'] as $row) {
?>
<tr>
<td><input type="radio" name="selectedItem" id="selectedItem" required="" value="<?php echo $row[0] ?>"></td>
<td><?php
echo row[0]</td>
</tr>
<?php
}
?>
</tbody>
</table><br>
<input type="submit" value="Next"/>
</form>
第二个文件:
$_SESSION['selectedItem1'] = filter_input(INPUT_POST,'selectedItem');
filter_input(INPUT_POST,'selectedItem')
不返回任何内容