jon
jon

Reputation: 15

How do i check multiple parameters in URL

http://example.com/retrieve1.php?Grade=&School=&Team=&Students=

How do i check multiple parameters in above URL ?I am using different search filters such as (Grade, School, Team, Students). So i would like to use the values of these filters from URL. I am not sure how to approach this, I would appreciate any help.

Upvotes: 0

Views: 47

Answers (1)

Murad Hasan
Murad Hasan

Reputation: 9583

URL: http://example.com/retrieve1.php?Grade=&School=&Team=&Students=

Two HTTP Request Methods: GET and POST

Two commonly used methods for a request-response between a client and server are: GET and POST.

GET - Requests data from a specified resource
POST - Submits data to be processed to a specified resource For your 

For your url its a GET method.

You can store the url parameter value using the GET Method.

$Grade = $_GET['Grade'];
$School= $_GET['School'];
$Team= $_GET['Team'];
$Students= $_GET['Students'];

You can also store the url parameter value using the REQUEST Method.

$Grade = $_REQUEST['Grade'];
$School= $_REQUEST['School'];
$Team= $_REQUEST['Team'];
$Students= $_REQUEST['Students'];

Note: The variables in $_REQUEST are provided to the script via the GET, POST, and COOKIE input mechanisms and therefore could be modified by the remote user and cannot be trusted. The presence and order of variables listed in this array is defined according to the PHP variables_order configuration directive.

Upvotes: 3

Related Questions