我想在提交时从单选按钮获取数据,但我不知道为什么我无法从单选按钮获取值。
我的代码
<?php
$choice = $_GET['choice'];
?>
<html>
<head>
</head>
<body>
<form action="index.php" method="POST">
<table align="center">
<tr><td>Please select</td></tr>
<tr><td><input type="radio" name="choice" value="0">aaaa</td></tr>
<tr><td><input type="radio" name="choice" value="1">bbbb</td></tr>
<tr><td><input type="radio" name="choice" value="2">cccc</td></tr>
<tr><td><input type="radio" name="choice" value="3">dddd</td></tr>
<tr><td><input type="submit" value="submit"></td></tr>
</table>
<?php echo"$choice";?>
</form>
</body>
</html>