我想在php中问一个问题
这是html表单代码
<form id="BlahForm" name="BlahForm" method="post" action="page1.php">
<input type="radio" name="rdPS" value="RJ"/> Space 1
<input type="radio" name="rdPS" value="SM" />Space 2
<input type="submit" name="submit" value="Submit">
</form>
这是PHP代码
if(isset($_POST['submit'])) // Check this line. Here I have Q-1
{
if(isset($_POST['rdPS'])) // Check this line. Here I have Q-2 & Q-3
{
$choice_port = $_POST["rdPS"];
}
else // Check this line. Here I have Q-4
{
$message = "Radio button not clicked";
}
}
现在以他们被问到的格式阅读问题.. Q-1。第一个 isset 是做什么的?if(isset($_POST['submit'])) (我知道 ISSET 检查提交按钮是否被点击?)
Q-2。2nd isset 是做什么的?(我在想这第二个 ISSET 检查是否单击了单选按钮。
Q-3 需要第二次吗?
Q-4 这 else 不起作用.. 为什么?
感谢您的帮助..