PHP的回顯名稱時,如何獲得點擊按鈕的值?PHP和MySQL單選按鈕名稱= PHP ECHO
這裏是我的代碼:
<form>
<input type='radio' name=<?php echo $i; ?> id='choice1' value=<?php echo $row['choices_a']; ?> checked/>
<?php echo '' .$row['choices_a']. '' ?>
<input type='radio' name=<?php echo $i; ?> id='choice2' value=<?php echo $row['choices_b']; ?> />
<?php echo ''.$row['choices_b'].''?>
<input type='radio' name=<?php echo $i; ?> id='choice3' value=<?php echo $row['choices_c']; ?> />
<?php echo ''.$row['choices_c'].''?> <br />
</form>
<?php
} echo $total;
?>
我的意思是我怎麼能從$ POST ['']得到值? –
你首先需要有效的html – rtfm
id ='choice1'value = <?php echo $ row ['choices_a']; ?> checked /> <?php echo''。$ row ['choices_a']。 ''?> id ='choice2'value = <?php echo $ row ['choices_b']; ?> /> <?php echo''。$ row ['choices_b']。''?> id ='choice3'value = <?php echo $ row ['choices_c']; ?> /> <?php echo''。$ row ['choices_c']。''?>
–