close
<body>
<form id="form1" name="form1" method="GET" action="php_form1.php">
請輸入月份:
<label for="month"></label>
<input type="text" name="month" id="month" />
<input type="submit" name="button" id="button" value="送出" />
</form>
</body>
.
<body>
<?php
$season = $_GET["month"];
if ($season >=1 && $season <= 3){
echo "現在是 $season 月,是春季。";
}elseif ($season>=4 && $season<= 5){
echo "現在是 $season 月,是夏季。";
}elseif ($season>=6 && $season<= 9){
echo "現在是 $season 月,是秋季。";
}elseif ($season>=10 && $season<=12){
echo "現在是 $season 月,是冬季。";
}else{
echo "請設定 1~12 範圍的數值。";
}
?>
</body>
文章標籤
全站熱搜
留言列表