PHP Submit Button Dilemma: Unavailable Echoes and Table
Your code intends to display echoes and a table when the "Submit" button is clicked on a PHP form. However, you've encountered an issue where these elements remain hidden. This is because you're using if(isset($_POST['submit'])) to control the display of these elements, but the submit button lacks a name attribute.
Solution: Providing a Button Name
To resolve this issue, you need to provide your submit button with a name attribute. This will bind it to the $_POST['submit'] array so that when the button is clicked, PHP can recognize it and execute the intended code block. Here's the corrected HTML:
Why Was the Button Name Missing?
In your original code, you defined the button without specifying a name. This is the missing element that prevents if(isset($_POST['submit'])) from functioning as expected. PHP cannot track the submit action without a button name to reference within the $_POST array.
Additional Notes
Disclaimer: All resources provided are partly from the Internet. If there is any infringement of your copyright or other rights and interests, please explain the detailed reasons and provide proof of copyright or rights and interests and then send it to the email: [email protected] We will handle it for you as soon as possible.
Copyright© 2022 湘ICP备2022001581号-3