Home >Backend Development >PHP Tutorial >PHP GET Method
The Get Method of the PHP Programming Language is very helpful in requesting the data from the specified/specific resource. It is one of the HTTP request methods of requesting the data from the particular resource. HTTP usually works just like the request-response protocol kind of thing which is between the server and the client. A client browser usually submits/sends some HTTP requests to the specific server but the server will return a specific response to the client. This request/response contains some status info about the specific request. That request process can be from the GET METHOD of the PHP Programming Language.
ADVERTISEMENT Popular Course in this category PHP DEVELOPER - Specialization | 8 Course Series | 3 Mock TestsStart Your Free Software Development Course
Web development, programming languages, Software testing & others
Syntax:
$_GET["name1"]
Usually, the GET method of the PHP Programming Language is an unsecured type of method because it will display most of all the info on the URL space/address bar space. Using the GET method is limited to the data sending but GET METHOD helps in sending the data so fast. It is also one of the associative array variables which will be passed to the current specific script via some URL parameters which is nothing but the query string. This array will request the query string. We can make the GET METHOD to work in the normal PHP Program by requesting the data from the specified or the specific source/resource.
The GET METHOD also works by sending some encoded info by the user which is appended to the specific page request. The page will now be the encoded info which is separated by the “?” character at the URL address bar space. GET method will produce a very long string that appears in the server logs in a specific browser’s location: box. It is restricted to 1024 characters sending only. If we pass some secure info/information like a password with the GET method then it will be sent to the server so it is better not to use for some important and secure info/information. The GET METHOD couldn’t be used to send some binary data like word docs, images, etc. to its own server/other. The data can be accessed with the help of the QUERY_STRING environment variable which is sent by the GET METHOD concept. To access the sent data/info $_GET is used most of all the time.
Below are the methods of PHP GET Method:
This is the example of using the GET METHOD of the PHP Programming Language. Here at first error_reporting() function is used to handle the error one time. Then x1 and y1 variables are used with the GET METHOD f1 and s1 values in it. Then z1 variable is created to sum up the x1 and y1 variable values. Then echo statement is to display the z1 variable value. Then in the form method GET method is used. Inside of the form
The above is the detailed content of PHP GET Method. For more information, please follow other related articles on the PHP Chinese website!