为什么这不起作用或者我只是愚蠢?它不打印任何东西,单击按钮后页面看起来完全一样(我的<form>
实际代码中有所有内容)
<html>
<input type="radio" name = "gender" value = "male">
<input type="radio" name = "gender" value = "female">
<input type="radio" name = "race" value = "asian">
<?php
if(isset($_POST["Button"]))
{
if(($_POST["gender"] == "male") && ($_POST["race"] == "asian"))
{
echo "you are male and asian";
}
}
?>
</html>
与之相关的整个代码区域如下所示:
<html>
<center>
<body>
<form method=post action= "">
<br>
<br>
Name: <input type="text" name="username">
<br>
<br>
<br>
I am:
<br>
<br>
<input type="radio" name = "gender" value = "male"> Male
<input type="radio" name = "gender" value = "female"> Female
<br>
<br>
</form>
<form method=post action= "">
Ethnicity:
<br>
<br>
<input type="radio" name = "race" value = "asian">Asian
<br>
<br>
<input type="radio" name = "race" value = "black">Black
<br>
<br>
<input type="radio" name = "race" value = "white">White
<br>
<br>
<br>
<input type="submit" name="Button" value = "Who will I marry?">
</form>
<?php
if(isset($_POST["Button"]))
{
if(($_POST["gender"] == "male") && ($_POST["race"] == "asian"))
{
?>
congrats!
<?
}
}
?>
</center>
</body>
</html>