Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the ways in which php submits data

2025-04-08 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces the relevant knowledge of "what are the ways of php to submit data". The editor shows you the operation process through an actual case. The operation method is simple, fast and practical. I hope this article "what are the ways of php to submit data" can help you solve the problem.

There are two ways for php to submit data: 1, get, add "method=" get "" attribute to the form tag to submit the form, the submitted data can be obtained through "$_ GET"; 2, post, the submitted data can be obtained through "$_ POST".

Operating environment of this tutorial: windows7 system, PHP7.1 version, DELL G3 computer

There are two ways for php to submit data: get and post.

1. Submit data through get

For example: https://www.yisu.com? Parameter name = parameter value & parameter name = parameter value

On the server side (on the side of the requested php file), you can get it through $_ GET. The index value of $_ GET is the parameter name, and the data corresponding to the index is the parameter value. The data submitted through get can be seen in the search bar of the site, and you can also fill in the data in the search bar of the site.

2. Submit data through post

For example, the form is sent through post and can be obtained through $_ POST.

Name: gender:

Data submitted through post is not visible

The difference between post and get

In terms of security, the data submitted by get is visible in the url column, while the data submitted by post is not visible, so post is more secure.

In principle, get submission is a submission of parameters, and post submission is a submission of all parameters as a whole.

In terms of the size of the committed data, the get commit is generally no more than 255bytes, and the size of the post commit depends on the server.

In terms of flexibility, get is very flexible, as long as there is a page jump can pass parameters, post is not flexible, post submission requires the participation of the form.

This is the end of the content about "how php submits data". Thank you for your reading. If you want to know more about the industry, you can follow the industry information channel. The editor will update different knowledge points for you every day.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report