提交总是错误的.显示错误:“;您尚未提交表格";;我正在使用Wampserver在本地机器上测试以下代码


Submit is always false. displays error: "you have not submitted the form!"; I am using Wampserver to test following code on local machine

我正在本地机器上使用Wampserver测试下面的代码,但点击提交后,我收到消息"您尚未提交表单!"

<body>
<!-- Start code for the form-->
<form method="post" name="myform" action="form.php">
    <p>
        <label for='name'>Enter Name: </label><br>
        <input type="text" name="name">
    </p>
    <p>
        <label for='email'>Enter Email Address:</label><br>
        <input type="text" name="email">
   </p>
    <p>
        <label for='message'>Enter Message:</label> <br>
        <textarea name="message"></textarea>
    </p>
    <input type="submit" name='submit' value="submit">
</form>
</body>
<!--form.php-->
<?php
    if (isset($_POST['submit']))
    {
        echo "you have not submitted the form!";
    }
    else 
    {
        echo "you have successfully submitted the form!";
    }
?> 

将代码更改为以下

<?php
if (isset($_POST['submit']))
{
    // if the form was submitted and the submit button was clicked
    echo "you have successfully submitted the form!";
}
else 
{
    echo "you have not submitted the form!";
}

?>