Why does the else output statement appear every time it is opened, that is, "It is not a numeric type or less than 0, please enter the correct score."? Also, why is it shown that the variable name $grades is not defined?
城南花已开
城南花已开 2018-12-04 09:13:58
0
1
1332

<form action="panduan.php" method="POST">

Determine the score segment:<br/>

<input type="text" name="grades">

<input type="submit" value="Submit">

</form>

<?php

$grades=$_POST['grades'];

if(is_numeric($grades)){

if($grades>=0&&$grades<60){

echo 'Failed';

}else if($grades>=60&&$grades<70){

echo 'Keep working hard';

}else if($grades>=70&&$grades<80){

echo 'Not bad';

}else if($grades>=80&&$grades<90){

echo 'There is hope for Tsinghua University';

}else if($grades>=90&&$grades<100){

echo 'There is no hope for you in this life ';

}else if($grades==100){

echo 'There is no hope';

}else if($grades>100){

echo 'Einstein is reincarnated, Smecta! ';

}

}else{

echo 'Not a numeric type or less than 0, please enter the correct score. ';

}

?>


城南花已开
城南花已开

reply all(1)
李铁蛋

There should be no errors in your code. I copied your code and ran it... Except for the different name of your file, it will run normally as long as you enter normal numbers. If it is a variable Undefined Just check your spelling

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template