There are mainly two methods to send information to the web server which are listed below:
Get Method: The GET method sends the encoded user information appended to the page request. The page and the encoded information are separated by the ‘?’ character.
For example:
https://www.google.com/search?q=hello
Program: This program illustrates the use of GET method in PHP:
<!DOCTYPE html>
<
html
>
<
head
>
<
title
>Get request</
title
>
</
head
>
<
body
>
<
form
action
=
"welcome.php"
method
=
"get"
>
<
table
>
<
tr
>
<
td
>First Name:</
td
>
<
td
><
input
type
=
"text"
name
=
"firstnamename"
></
td
>
</
tr
>
<
tr
>
<
td
>E-mail:</
td
>
<
td
><
input
type
=
"text"
name
=
"emailid"
></
td
>
</
tr
>
<
tr
>
<
td
></
td
>
<
td
style
=
"float:right;"
><
input
type
=
"submit"
></
td
>
</
tr
>
</
table
>
</
form
>
</
body
>
</
html
>
<html>
<body>
Welcome to GeeksforGeeks!<br>
First Name: <?php
echo
$_GET
[
"firstname"
]; ?><br>
Email Address: <?php
echo
$_GET
[
"emailid"
]; ?>
</body>
</html>
Output: