我是php和MYSQL的新手。对于摩洛哥油,单击“是”或“否”时,将检查单选按钮。但是,单击时打印状态为是/否。无论如何都会检查默认的否。你能帮我解决这个问题吗?谢谢!
echo '<tr>
<td>' . _('Signed Moroccan Oil?') . '</td>';
if(strtoupper($_POST['signedMor']) == 'YES'){
echo '<td> <input type="radio" name="signedMor" id="signedMor" value="Yes" checked="checked">Yes
<input type="radio" name="signedMor" id="signedMor" value="No">No</td>';
} else {
echo '<td> <input type="radio" name="signedMor" id="signedMor" value="Yes">Yes
<input type="radio" name="signedMor" id="signedMor" value="No" checked="checked">No</td>';
}
echo '</tr>';
echo '<tr>
<td>' . _('Print Statement?') . '</td>';
if(strtoupper($_POST['printStatement']) == 'Y'){
echo '<td> <input type="radio" name="printStatement" id="printStatement" value="Y" checked="checked">Yes
<input type="radio" name="printStatement" id="printStatement" value="N">No</td>';
} else {
echo '<td> <input type="radio" name="printStatement" id="printStatement" value="Y">Yes
<input type="radio" name="printStatement" id="printStatement" value="N" checked="checked">No</td>';
}
echo '</tr>';