我有多个选项供用户选择费率。如果用户选择不收费,则该值将为0.00。当用户提交表单时,我希望它显示" No Charge"在电子邮件而不是0.00
为什么这不起作用?
<div class="col-sm-9">
<label class="checkbox-inline">
<input type="radio" class="px" name="radiochoice" id="radio11" class="radio" value="0.00" />
<span class="lbl">No Charge</span>
</label>
<br>
</div>
<div class="col-sm-9">
<label class="checkbox-inline">
<input type="radio" class="px" name="radiochoice" id="radio7" class="radio" value="185.00" />
<span class="lbl">Networking: $185.00</span>
</label>
<br>
</div>
PHP
$radiochoice = $_POST['radiochoice'];
$nochargevalue = 0.00;
if ($radiochoice == $nochargevalue) {
$radiochoice = "No Charge";
} else {
}
电子邮件
<th style="background:#ebebeb;border-color: #ebebeb;">Rate</label></th>
<td>' . $_POST['radiochoice'] .' </td>
感谢@Stevish - 我很伤心,我错过了这个:
<th style="background:#ebebeb;border-color: #ebebeb;">Rate</label></th>
<td>' . $radiochoice .' </td>