これは一部の人にとっては初心者の質問かもしれませんが、私はこれを理解できません。ほら、私が持っているのは単純なテキスト ボックスと送信ボタンだけです。テキスト ボックスには数字を入力する必要があります (ユーザーの給与である必要があります)。どのブラウザでもphpファイルをロードするたびに、このエラーが発生しました(下の画像を参照)。35 行目にあるのはコードですか?
$a = $_POST['salary'];
それの何が悪いのかわからない...
<form method="POST">
Salary: <input id="salarytext" type="text" name="salary" onkeypress="return isNumberKey(event)"><br>
<input type="submit" />
</form>
<?php
$a = $_POST['salary'];
?>
<?php
switch($a) {
case ($a==""): echo "Input first your Compensation for the period!";
break;
case ($a < 1000 ): echo "Your Compensation is too low. You are not required to contribute for the period.";
break;
case ($a >=1000 && $a <=1249.99): echo "Your ER is 80.7 and Your EE is 33.30";
break;
case ($a >=1250 && $a <=1749.99): echo "Your ER is 116 and Your EE is 50.00";
break;
case ($a >=1750 && $a <=2249.99): echo "Your ER is 151.3 and Your EE is 66.70";
break;
case ($a >=2250 && $a <=2749.99): echo "Your ER is 186.7 and Your EE is 83.3";
break;
case ($a >=2750 && $a <=3249.99): echo "Your ER is 222 and Your EE is 100";
break;
case ($a >=3250 && $a <=3749.99): echo "Your ER is 257.3 and Your EE is 116.7";
break;
case ($a >=3750 && $a <=4249.99): echo "Your ER is 292.7 and Your EE is 133.3";
break;
case ($a >=4250 && $a <=4749.99): echo "Your ER is 328 and Your EE is 150";
break;
case ($a >=4750 && $a <=5249.99): echo "Your ER is 363.3 and Your EE is 166.7";
break;
case ($a >=5250 && $a <=5749.99): echo "Your ER is 398.7 and Your EE is 183.3";
break;
case ($a >=5750 && $a <=6249.99): echo "Your ER is 434 and Your EE is 200";
break;
case ($a >=6250 && $a <=6749.99): echo "Your ER is 469.3 and Your EE is 216.7";
break;
case ($a >=6750 && $a <=7249.99): echo "<span>Your ER is 504.7 and Your EE is 233.3 </span>". "with a total SSS Contribution of 738.00" ;
break;
case ($a >=7250 && $a <=7749.99): echo "Your ER is 540 and Your EE is 250";
break;
case ($a >=7750 && $a <=8249.99): echo "Your ER is 575.3 and Your EE is 266.7";
break;
case ($a >=8250 && $a <=8749.99): echo "Your ER is 610.7 and Your EE is 283.3";
break;
case ($a >=8750 && $a <=9249.99): echo "Your ER is 646 and Your EE is 300";
break;
case ($a >=9250 && $a <=9749.99): echo "Your ER is 681.3 and Your EE is 316.7";
break;
case ($a >=9750 && $a <=10249.99): echo "Your ER is 716.7 and Your EE is 333.3";
break;
case ($a >=1025 && $a <=10749.99): echo "Your ER is 752 and Your EE is 350";
break;
case ($a >=1075 && $a <=11249.99): echo "Your ER is 787.3 and Your EE is 366.7";
break;
case ($a >=1125 && $a <=11749.99): echo "Your ER is 822.7 and Your EE is 383.3";
break;
case ($a >=1175 && $a <=12249.99): echo "Your ER is 858 and Your EE is 400";
break;
case ($a >=1225 && $a <=12749.99): echo "Your ER is 893.3 and Your EE is 416.7";
break;
case ($a >=1275 && $a <=13249.99): echo "Your ER is 928.7 and Your EE is 433.3";
break;
case ($a >=1325 && $a <=13749.99): echo "Your ER is 964 and Your EE is 450";
break;
case ($a >=1375 && $a <=14249.99): echo "Your ER is 999.3 and Your EE is 466.7";
break;
case ($a >=1425 && $a <=14749.99): echo "Your ER is 1034.7 and Your EE is 483.3";
break;
case ($a >=1475 && $a <=30000): echo "Your ER is 1090 and Your EE is 500";
break;
default:
echo " Your ER is 1090 and Your EE is 500. Your Salary for the Period reached the Maximum Range of Compensation. ";
break;
}
?>