我有多个问题,每个问题有 4 个答案,我在 PHP 中显示所有问题及其答案,方法是:
while($row=mysqli_fetch_array($rs))
{
echo "question:".$row['question']."<br>";
?>
<input type="hidden" name="id[<?php echo $row[id] ?>]" value="<?php echo $row[id] ?>" />
<?php echo $row['op1'] ?>
<input type="radio" name="opt[<?php echo $row['id'] ?>]" value="<?php echo $row['op1'] ?>-<?php echo $row['id'] ?>" /><br>
<?php echo $row['op2'] ?>
<input type="radio" name="opt[<?php echo $row['id'] ?>]" value="<?php echo $row['op2'] ?><?php echo $row['id'] ?>" /><br>
<?php echo $row['op3'] ?>
<input type="radio" name="opt[<?php echo $row['id'] ?>]" value="<?php echo $row['op3'] ?><?php echo $row['id'] ?>" /><br>
<?php echo $row['op4'] ?>
<input type="radio" name="opt[<?php echo $row['id'] ?>]" value="<?php echo $row['op4'] ?><?php echo $row['id'] ?>" /><br>
<?php
}
?>
<input type="submit" value="answer" /><br>
如何获取下一页上每个 $row['id'] 的单选按钮值。