Home >Backend Development >PHP Tutorial >What does submit mean? PHP determines the difference between if$_POST[submit] and ifisset$_POST[submit] when submitting a form.
What does submit mean?
Submit object represents a submit button in an HTML form.
This article explains to you the difference between php judging if($_POST[submit]) and if(isset($_POST[submit])) when receiving a submitted form, interested students can refer to it.
if(isset($_POST['submit'])) Does it mean to determine whether the $_POST['submit'] variable is configured? If this variable is executing other code
should be used like this
if(isset($_POST['submit'])) { }
The difference between if($_POST[submit]) and if(isset($_POST[submit])) when submitting the form
A warning will appear in the first method , the second one is relatively more rigorous.
Also, it is best to add single quotes to the POST key name, which is slightly more efficient (about 3-4 times).
Well, it almost means that. If this variable is set, it will return true.
if(isset($_POST['Submit'])) in PHP means:
isset -- detect whether the variable is set.
Judge whether the posted data has been submitted. Come here
The code is as follows:
if(isset($_POST["submit"]){ echo "提交过来了"; }else { echo "submit is no come~"; }
The above is the difference between if$_POST[submit] and ifisset$_POST[submit] when submitting a form in PHP, including the meaning of submit. I hope it will help friends on the PHP Chinese website Helps.