html页面:
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<h1>分数</h1>
<form action="work.php" method="post">
<input type="text" name="fs">
<input type="submit" value="提交">
</form>
</body>
</html>
php页面:
<?php
$fs=$_POST['fs'];
echo $fs.'<br/>';
if($fs >= 0 && $fs < 60 ){
echo '不及格';
}elseif($fs >= 60 && $fs < 70){
echo '及格了,要努力';
}else if($fs >= 70 && $fs < 80){
echo '还不错';
}else if($fs >= 80 && $fs < 90){
echo '上清华有希望';
}else if($fs >= 90 && $fs < 100){
echo '清华有机会上了';
}elseif($fs >= 100 ){
echo '爱因斯坦转世啊,思密达';
}elseif(!is_numeric($fs) && $fs < 0){
echo '请输入正确的分数';
}
?>