Home >Backend Development >PHP Tutorial >Determine the difference between if($_POST[submit]) and if(isset($_POST[submit])) when submitting a form in PHP_PHP Tutorial
This should be used if(isset($_POST['submit'])) {
}
The difference between if($_POST[submit]) and if(isset($_POST[submit])) when submitting a form
The first method will cause a warning, while the second method is relatively more rigorous.
Also, it is best to add single quotes to the POST key name, so that the efficiency is slightly higher (about 3-4 times).
Well, it almost means that. If this variable is set, it returns true
What does if(isset($_POST['Submit'])) mean in PHP?
isset -- Check whether the variable is set
Determine whether the posted data has been submitted