为什么我的if else代码不起作用 [英] why my if else code is not working

查看:102
本文介绍了为什么我的if else代码不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Welcome <?php echo $_GET["name"]; ?><br>
Your email address is: <?php echo $_GET["email"]; ?><br>

<?php
if ($_GET["ano"]<=1000) {
    $num=16000;
    echo "Your salary is ₹", number_format($num);
} else if($_GET["ano"]>=1000 || $_GET["ano"]<=2000) {
    $num=35000;
    echo "Your salary is ₹", number_format($num);
}

else {
    $num=50000;
    echo "Your salary is ₹", number_format($num);
}

?>
<form action="$_GETt1.php" method="get">
<input type="submit" value="GO BACK">
</form>





当我输入的值小于1000时,它给出了正确的结果。



当我输入的值超过1000,小于2000时,它给了我正确答案。



但是,如果我输入超过2000,它再次给我薪水35000,实际上在1000和2000段。



有人能帮帮我吗?



when i input value less than 1000, it gives me right result.

when i enter value more than 1000, less than 2000, it gives me correct answer.

But, if i input more than 2000, it again gives me salary as 35000 which actually lies in 1000 and 2000 segment.

can someone help me?

推荐答案

_GET [name]; ?> <峰; br>
您的电子邮件地址是:<?php echo
_GET["name"]; ?><br> Your email address is: <?php echo


_GET [email]; ?> <峰; br>

<?php
if(
_GET["email"]; ?><br> <?php if (


_GET [ano]< = 1000){
_GET["ano"]<=1000) {


这篇关于为什么我的if else代码不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆