这是我的代码:
$isYes = FALSE;
$isNo = FALSE;
if (!empty($_POST['owner'])) {
 $o = trim($_POST['owner']);
 if ($_POST['owner'] == 'yes') {
     $isYes = TRUE;
 } else if($_POST['owner'] == 'no'){
     $isNo = TRUE;
     }
 }
<p><label>Is the Applicant the owner?   
Yes<input type="radio" name="owner" id="owner_yes" class="owner" value="yes" 
<?php print($isYes ? "CHECKED" : ""); ?> />
No<input type="radio" name="owner" id="owner_no" class="owner" value="no" 
<?php print($isNo ? "CHECKED" : ""); ?>/></label></p>
每当用户第一次加载页面时,都会出现以下错误:
注意:** 未定义变量:第 299 行 C:\xampp\htdocs\index.php 中的
isYes 注意:** 未定义变量:第 301 行 C:\xampp\htdocs\index.php 中的 isNo
那是因为用户还没有在上面填写的收音机中选择“是”或“否”,但是在他们点击提交并返回修复他们可能搞砸的地方后,错误消失了,因为$isYes现在$isNo有一个值。
我该如何解决这个错误?提前谢谢各位!