提交总是错误的。 显示错误:“您尚未提交表单!”; 我正在使用Wampserver在本地计算机上测试以下代码

I am using Wampserver on local machine to test the code below but after clicking on submit I get message "you have not submitted the form!"

<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!";
    }

?> 

change your code to the following

<?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!";
}

?>