我在 html 表格和表单中有一个单选按钮。当单选按钮的值是文本时,按钮返回零。但是,当值是数字时,按钮返回 rue 值。代码如下。
<form method="POST" action='insert_per.php'>
<table >
<thead>
<tr>
<th class="center"><strong>Name</strong></th>
<th class="center"><strong>Email</strong></th>
<?PHP if($_SESSION['user_group'] == 63){
echo '<th class="center"><strong>System Admin</strong></th>';
echo '<th class="center"><strong>Admin</strong></th>';
echo '<th class="center"><strong>User</strong></th>';
}
</tr>
</thead>
<?php
if($stmt->execute()){
// output data of each row
while($rows = $stmt->fetch(PDO::FETCH_ASSOC)){ ?>
<tr>
<td border="0" type="hidden" style="display:none;"><input type="hidden" name="hidden" value=<?php echo $rows['member_id']; ?></td>
<td class="center"><?php echo $rows['username']; ?></td>
<td class="center"><?php echo $rows['email']; ?></td>
<td class="center"><input type="radio" name="gp" value=11></input></td>
<td class="center"><button name="submit" type="submit">submit</button></td>
</tr>
<?php
}
}
?>
</table>
</form>
单选按钮发布 11 但是当单选按钮的值从 11 更改为文本(例如“欢迎”)时,单选按钮的表单发布值为零“0”