Home > Database > Mysql Tutorial > body text

Why is My Echo and Table Not Displaying After Clicking the Submit Button?

Linda Hamilton
Release: 2024-11-06 20:35:02
Original
152 people have browsed it

Why is My Echo and Table Not Displaying After Clicking the Submit Button?

Why if(isset($_POST['submit'])) Prevented Echo Display When Submit Button Clicked

When attempting to suppress echo and table display until the form's submit button is clicked using the if(isset($_POST['submit'])) function, issues arise. The echos and table remain concealed even when the submit button is clicked.

The error stems from the submit button's missing name attribute. Without a name, the $_POST['submit'] variable becomes inaccessible, preventing the if(isset($_POST['submit'])) function from executing properly.

Solution

To resolve this issue, assign a name to the submit button:

<p><input type="submit" value="Submit" name="submit" /></p>
Copy after login

With this modification, the if(isset($_POST['submit'])) function will function correctly, triggering the display of echos and the table when the submit button is pressed.

The above is the detailed content of Why is My Echo and Table Not Displaying After Clicking the Submit Button?. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!