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? PHP determines the difference between if$_POST[submit] and ifisset$_POST[submit] when submitting a form.

PHP中文网
Release: 2016-07-29 08:44:21
Original
2416 people have browsed it

What does submit mean?

Submit object represents a submit button in an HTML form.

What does submit mean? PHP determines the difference between if$_POST[submit] and ifisset$_POST[submit] when submitting a 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'])) { 
}
Copy after login

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~"; 
}
Copy after login

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.

Related labels:
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