What does it mean when PHP submits a form to determine the difference between if$_post[submit] and Ifisset$_post[submit]

Source: Internet
Author: User
What do you mean by submit?

The Submit object represents one of the submit buttons in the HTML form (the Submit button).

This article is to explain that PHP receives the submission form when judging if ($_post[submit]) and if (Isset ($_post[submit)), the difference between interested students reference.

if (Isset ($_post[' submit '))) does it mean to determine whether the $_post[' submit ' variable is configured? If there is a variable in the execution of other code

It 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 appear a warning, the second relatively more rigorous.
There is also the key name of the post is best added single quotation marks, so the efficiency is slightly higher (about 3-4 times).
Well, that means, if you set this variable, it returns TRUE.
PHP if (isset ($_post[' Submit ')) means:
Isset--Detect if the variable is set
Determine if the post data has been submitted.

The code is as follows:

if (Isset ($_post["Submit") {echo "was submitted";} else {echo "Submit is no come~";}

The above is the PHP submission form when judging if$_post[submit] and Ifisset$_post[submit] The difference, including the content of what meaning to submit, I hope to topic.alibabacloud.com friends have some help.

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.