I have a PHP page where there are some text boxes and a button.
When user fills the texts and click on submit button, the information is inerted to database table.
However, my problem is, when user just just navigates to the page, the page code gets executed and blank values are inserted in database table.
How I can ensure the PHP code runs only when user clicks the button not just when the page is refreshed.
My button defined as
<input type="submit" value="Add Information">
PHP codes are defined within
<?php ... ?>
However, I seemed to have no code to tell only execute PHP part when button is clicked.
Thanx 😕