$ _ REQUEST in php

Source: Internet
Author: User
Tags html header
$ _ REQUEST in php
This is actually set in the PHP configuration file. let's take a look at php. the ini configuration file contains the following content in about 466th rows:; This directive describes the order in which PHP registers GET, POST, Cookie,; Environment and Built-in variables (G, p, C, E & S respectively, often; referred to as EGPCS or GPC ). registration is done from left to right, newer; values override older values. variables_order = "EGPCS" this EGPCS indicates the priority of the content obtained using the $ _ REQUEST array. The letter meanings of the EGPCS are: E generation table $ _ ENV, and G stands for $ _ GET, P stands for $ _ POST, C stands for $ _ COOKIE, and S stands for $ _ SESSION. The subsequent data will overwrite the previously written data. the default data writing method is EGPCS. Therefore, the data contained in the POST will overwrite the data with the same keywords in GET.
====================================================================================================

In php, $ _ request, $ _ post, and $ _ get are used to accept form data. What are the differences between them and when to use the best form data.
I. differences and features between $ _ request and $ _ post and $ _ get
$ _ REQUEST [] uses the $ _ POST [] $ _ GET [] function, but $ _ REQUEST [] is slow. All data submitted through the post and get methods can be obtained through the $ _ REQUEST array.
II. differences and features of $ _ post and $ _ get
1. get is to get data from the server, and post is to send data to the server.
2. get is to add the parameter data queue to the URL referred to by the ACTION attribute of the submission form. the values correspond to each field in the form one by one and can be seen in the URL. Post uses the HTTP post mechanism to place fields in the form and their content in the html header and send them to the URL address referred to by the ACTION attribute. You cannot see this process.
3. for the get method, the server uses Request. QueryString to obtain the value of the variable. for the post method, the server uses Request. Form to obtain the submitted data.
4. the data volume transmitted by get is small and cannot exceed 2 kB. The amount of data transmitted by post is large, which is generally not restricted by default. Theoretically, the maximum size of IIS4 is 80 kB, and that of IIS5 is 100KB.
5. Low get security and high post security.
Example: mypage? Id = 1: This is the GET method for passing values. you can use $ _ request and $ _ get to receive values.

Differences between $ _ request and $ _ post and $ _ get in php


In php, $ _ request, $ _ post, and $ _ get are used to accept form data. What are the differences between them and when to use the best form data.

I. differences and features between $ _ request and $ _ post and $ _ get

$ _ REQUEST [] uses the $ _ POST [] $ _ GET [] function, but $ _ REQUEST [] is slow. All data submitted through the post and get methods can be obtained through the $ _ REQUEST array.

II. differences and features of $ _ post and $ _ get

1. get is to get data from the server, and post is to send data to the server.
2. get is to add the parameter data queue to the URL referred to by the ACTION attribute of the submission form. the values correspond to each field in the form one by one and can be seen in the URL. Post uses the HTTP post mechanism to place fields in the form and their content in the html header and send them to the URL address referred to by the ACTION attribute. You cannot see this process.
3. for the get method, the server uses Request. QueryString to obtain the value of the variable. for the post method, the server uses Request. Form to obtain the submitted data.
4. the data volume transmitted by get is small and cannot exceed 2 kB. The amount of data transmitted by post is large, which is generally not restricted by default. Theoretically, the maximum size of IIS4 is 80 kB, and that of IIS5 is 100KB.
5. Low get security and high post security.

Example: mypage? Id = 1. this is the GET method for passing values. you can use $ _ request and $ _ get to send values.

Certificate -----------------------------------------------------------------------------------------------------------------------------------

Http get variable: $ _ GET
Note: PHP 4.1.0 and later versions are used. In earlier versions, $ HTTP_GET_VARS is used.
An array composed of variables passed through the http get method. Is an automatic global variable.
This is a "superglobal", or it can be described as an automatic global variable. This only means that it is valid in all scripts. You do not need to use global $ _ GET; to access a function or method, just like using $ HTTP_GET_VARS.
$ HTTP_GET_VARS contains the same information, but it is not an automatic global variable (note: $ HTTP_GET_VARS and $ _ GET are different variables, and PHP processes them differently ).
If the register_globals command is set, these variables are also available in all scripts; that is, the $ _ GET and $ HTTP_GET_VARS arrays are separated. For more information, see the security section using Register Globals. These independent global variables are not automatic global variables.
Http post variable: $ _ POST
Note: PHP 4.1.0 and later versions are used. Of

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.