我已经制作了两个文件 php,一个有验证 php 代码,另一个有我输入一些数据的表单,但看起来 Switch 命令有问题,看了很多次才发现问题,但不幸的是我没有得到 true .
这是我的代码;
我已经形成的第一个文件
<form action="Validation_search_02.php" method="post">
<label>Your favourite fruit:<input type="text" name="t_Opst" id="t_Opst"></label>
<input type="submit" name="G_mby" id="G_mby">
</form>
我有验证文件的第二个文件(php)
<?php
if(isset($_P0ST["G_mby"])){
$L_ings=$_POST["t_Opst"];
switch($L_ings){
case "Apple":
echo "Your favourite fruit is $L_ings";
break;
case "Pear":
echo "Your favourite fruit is $L_ings";
break;
case "Banana":
echo "Your favourite fruit is $L_ings";
break;
case "Mango":
echo "Your favourite fruit is $L_ings";
break;
default:
echo "You should eat some fruit";
}
}
?>
宝慕林4294392