"; if($_POST['num1']==""){ $bz = false; $errs .= "第一个数为空 "; } if($_POST['num2']==""){ $bz = false; $errs .= "第二个数为空 "; } if($bz){ $sum = ""; switch($_POST['ysf']){ case '+': $sum = $_POST['num1'] + $_POST['num2']; break; case '-': $sum = $_POST['num1'] - $_POST['num2']; break; case '*': $sum = $_POST['num1'] * $_POST['num2']; break; case '/': $sum = $_POST['num1'] / $_POST['num2']; break; } } }?>Easy Calculator
"; } else{ echo $errs; } ?> |