[Osaka/Yokohama/Tokushima] Looking for infrastructure/server side engineers!

[Osaka/Yokohama/Tokushima] Looking for infrastructure/server side engineers!

[Deployed by over 500 companies] AWS construction, operation, maintenance, and monitoring services

[Deployed by over 500 companies] AWS construction, operation, maintenance, and monitoring services

[Successor to CentOS] AlmaLinux OS server construction/migration service

[Successor to CentOS] AlmaLinux OS server construction/migration service

[For WordPress only] Cloud server “Web Speed”

[For WordPress only] Cloud server “Web Speed”

[Cheap] Website security automatic diagnosis “Quick Scanner”

[Cheap] Website security automatic diagnosis “Quick Scanner”

[Reservation system development] EDISONE customization development service

[Reservation system development] EDISONE customization development service

[Registration of 100 URLs is 0 yen] Website monitoring service “Appmill”

[Registration of 100 URLs is 0 yen] Website monitoring service “Appmill”

[Compatible with over 200 countries] Global eSIM “Beyond SIM”

[Compatible with over 200 countries] Global eSIM “Beyond SIM”

[If you are traveling, business trip, or stationed in China] Chinese SIM service “Choco SIM”

[If you are traveling, business trip, or stationed in China] Chinese SIM service “Choco SIM”

[Global exclusive service] Beyond's MSP in North America and China

[Global exclusive service] Beyond's MSP in North America and China

[YouTube] Beyond official channel “Biyomaru Channel”

[YouTube] Beyond official channel “Biyomaru Channel”

About the difference between GET and POST

nice to meet you! My name is Hase, and I joined the development team as a new graduate this year.
This time, I would like to explain the difference between "GET" and "POST", which are used when passing information in PHP, for beginners to programming.

What are GET and POST?

This refers to the method used when passing data such as input forms to a web server.

Features of GET

  • Add data after the URL and send.
  • Since the data is written in the URL, the data entered by others will be completely visible.
  • URLs have a limited number of characters (the maximum number of characters that can be used in Internet Explorer URLs is 2,048), which limits the amount of data that can be sent.
  • Only text data can be sent (binary data such as image data cannot be sent as it cannot be written in the URL).

Example: http://localhost/sample/confirm.php?name=%E5%B1%B1%E7%94%B0%E5%A4%AA%E9%83%8E&age=22

"?" is the beginning of a parameter.
"&" is a parameter separator.
The left side of "=" is the GET variable name, and the right side is the value to be passed.
The value passed is %E5%B1%B1%E7... because Japanese is converted. (Japanese cannot be used in URLs)

Features of POST

  • Data is not appended to the URL.
  • Since no data is written in the URL, the data cannot be viewed by others.
  • Can be sent without any limit on the amount of data.
  • Both text and binary can be sent.

Example: http://localhost/sample/confirm.php

How to use GET and POST

It is best to use POST if the following apply to you

If you have a large amount of data

As mentioned above, the maximum number of characters that can be used in a URL in Internet Explorer is 2,048 characters, and
in the case of GET, the data is added after the URL and sent, which limits the amount of data that can be sent.
Therefore, if the amount of data is large, please use POST.

When sending confidential information

If there is information in the data that you do not want outsiders to know, such as an email address or password,
if you use GET, the data information will be added after the URL, making it visible to others.
Therefore, please use POST when sending confidential information.

When sending binary data

Please use POST when sending binary data such as images.

At the end

If you want to share the data via URL, and you don't mind others seeing the data, you can use GET.
However, if your form contains personal information, such as a personal information input form or product order form, be sure to use POST.
That's it.

If you found this article helpful , please give it a like!
0
Loading...
0 votes, average: 0.00 / 10
4,357
X facebook Hatena Bookmark pocket
[2025.6.30 Amazon Linux 2 support ended] Amazon Linux server migration solution

[2025.6.30 Amazon Linux 2 support ended] Amazon Linux server migration solution

[Osaka/Yokohama] Actively recruiting infrastructure engineers and server side engineers!

[Osaka/Yokohama] Actively recruiting infrastructure engineers and server side engineers!

The person who wrote this article

About the author

Tatsuya Hase

Joined Beyond Co., Ltd. as a new graduate.

We develop web systems (development of services and systems that run on browsers, such as web services, digital content, and business management systems) and game APIs (development of programs that communicate with application games).

We also develop private/custom apps for Shopify.

Originally worked at the Osaka office, but transferred to the Yokohama office in 2019.
His hobbies are baseball/karaoke/anime