<HTML>
<body>
<?php
echo "<H4>Are you a Male</h4>"
?>
<form action ="ifstat.php" method ="post">
Enter Please: <input type="text" name="val1">
<input type ="submit" >
<input type ="reset">
</form>
<?php
$isMale=$_POST["val1"];
if($isMale =="y" || "yes"){
echo("You are a Male");
} elseif($isMale =="n" || "no") {
echo("You are a female");
} else{
echo("Invalid entry");
}
?>
</body>
</html>
所以,这是我的程序代码。即使我输入“n”或其他值而不是 y,我也总是不断地将 You are a Male 作为输出。这里的代码有什么问题?
这是输出的照片https://imgur.com/a/PPH49GK
翻翻过去那场雪
有只小跳蛙