GET Methods

0 adelemckean6404 December 12, 2020

This is the collection of array variables that pass through the HTTP GET methods. The $_GET variable uses to collect the value from the URL parameter. These parameters may be sent using PHP form with action GET.

Lets take an URL with parameter that we can access via HTTP GET Request.

In the above URL, We can access the type and language parameter using HTTP GET methods as shown below.


    echo $_GET['type'];
    echo $_GET['language'];


The output of the above program is


If we use form for the get methods then we can use the form as below:

<form action="" method="get">
   <input type="text" name="name" placeholder="Full Name"/>
   <input type="button" value="Submit" />

If we submit the above form then we can access the user input value using the $_GET[‘name’] variable.