Rumah > Soal Jawab > teks badan
这个代码为什么没法运行呢? 网页直接无法显示 <!doctype html> <html> <head> <meta charset="utf-8"> <title>计算</title> </head><body> <form method="post"> <input type="text" name="number1"> <select name=lable size=1 face="黑体"> <option>+</option> <option>-</option> <option>*</option> <option>/</option> </select> <input type="text" name="nunber2"> <input type="submit" name="button" value="提交"> </form> <? php function yx ($s1,$s2,$b) { if($b=="+") return ($s1+$s2); else if ($b=="-") return ($s1-$s2); else if ($b=="*") return ($s1*$s2); else return($s1/$s2); } if(isset($_POST['button'])) $s1=$_POST["number1"]; $s2=$_POST["number2"]; $b=$_POST["lable"]; if(is_nameric($s1)&&is_nameric($s2)) $r=yx($s1,$s2,$b); echo "结果为".$r; else echo "请重新输入"; ?> </body> </html>