Get&post of PHP forms

Source: Internet
Author: User
Tags http post
I. Contact and difference between get and post

1. Contact for Get and post

  • Both GET and POST create arrays (for example, array (key = value, Key2 = value2, Key3 = Value3, ...) )。 This array contains key/value pairs, where the key is the name of the form control, and the value is the input data from the user.
  • Get and POST are treated as $_get and $_post. They are hyper global variables , which means that access to them does not need to be scoped-no special code is required, and you can access them from any function, class, or file.
  • 2. The difference between get and post

  • $_get is an array of variables passed to the current script through a URL parameter .
  • $_post is an array of variables passed through HTTP POST to the current script.
  • Ii. use of Get and post

    1, when to use?

  • Get usage Scenario: Non-sensitive data visible to anyone, limited to 2000 characters, displayed in the URL;
  • Post usage scenario: invisible to others, unlimited number of characters, embedding HTTP request body, support for higher-order functions.
  • 2, how to use?

  • Using get
  • ? Keyword=google&position=china "> Search
     
     
  • Using Post
  •  
     

    Copyright NOTICE: This article for Lshare original article, need to reprint please contact me, have questions welcome comments or private messages.

  • Related Article

    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.