1. use the post method to submit a form: change the method label attribute in the form to ldquo and postrdquo. Features: The post method does not depend on the url and will not be displayed in the address bar. Post party...
1. use the post method to submit a form
Usage: The method label attribute in the form is changed to "post"
Feature: The post method does not depend on the url and will not be displayed in the address bar. The post method can transmit data to the server without restrictions. all submitted information is transmitted in the background, and the user cannot see this process on the browser side, which is highly secure.
Used to send confidential or large data to the server.
Instance:
Post submission does not show the value of the submission form on the url
2. use the get method to submit a form
The $ _ get variable is an array with the variable name and value sent by the http get method.
The $ _ get variable is used to collect the values in the form from method = "get" and send information from the form with the get method, it is visible to anyone (displayed in the address bar of the browser) and limited to the amount of information sent (up to 100 characters ).
Usage: The method label attribute in the form is changed to "get"
Feature: The get method is used to submit the form data and append it to the url as part of the url to the server. the url displays the content of the transmitted data.
Format: http: // url? Name1 = value1 & name2 = value2...
Url: The form response address.
Name1: name of the form element
Value1: the value of the name1 form.
$: Delimiter between multiple form elements
Instance:
Use get to submit form data
From the above two points, we can see that the two submission methods have two completely different data transmission modes. Using post to submit the data in the form, the data information is completely transmitted in the background, the data is not displayed in the url information of the browser, while the data in the get submission form is displayed in the url. Today, we will introduce these two data submission methods here.
Note: The http get method is not suitable for large variable values. The value cannot exceed 100 characters.
$ _ Request variable
The $ _ request variable in php contains $ _ get, $ _ post, and $ _ cookie content.
The $ _ request variable of php can be used to obtain the results of form data sent through the get and post methods.
The PHP instance is as follows:
welcome
you are
Article address:
Reprint at will ^ please include the address of this article!