search

Home  >  Q&A  >  body text

Cannot output if it is greater than 100

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<title>Insert title here</title>

</head>

<body>

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

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

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

</form>

</body>

</html>

<?php

$num=$_POST['num'];

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

echo 'Failed';

}elseif ($num>=60&&$num<70){

echo 'You passed, you have to work hard. ';

}elseif ($num>=70&&$num<80){

echo 'Not bad. ';

}elseif ($num>=80&&$num<90){

echo 'There is hope for Tsinghua University. ';

}elseif ($num>=90&&$num<100){

echo 'You have no hope in this life. ';

}elseif ($num=100){

echo 'There is no hope. ';

}elseif ($num>100){

echo 'Einstein is reincarnated, Smecta! ';

}else {

echo 'Please enter the correct score';

}

?>


WINGWING2476 days ago1337

reply all(4)I'll reply

  • 寻觅 beyond

    寻觅 beyond2018-02-02 16:12:52

    If you want to determine equality, you should use two equal symbols ==

    a==b to determine whether a is equal to b

    a = b and assign b to a

    reply
    0
  • 寻觅 beyond

    寻觅 beyond2018-02-02 16:11:49

    }elseif ($num=100){ Here, an equal represents an assignment. Assign 100 to $num. The assignment is always true and will not continue to judge subsequent conditions.

    reply
    0
  • WING

    Well, thank you

    WING · 2018-02-02 16:17:12
  • 不靠譜°ζ

    不靠譜°ζ2018-02-02 14:12:11

    There is less equal sign after the greater than sign

    reply
    1
  • WING

    But there is an equal sign in front of it

    WING · 2018-02-02 14:37:19
  • Cancelreply