$_GET : to recive varaible or formdata from GET REQUEST

Can be recived if Query is generated

Query String each varible will a key in $_GET

?name=ravi&class=12


$name = $_GET['name'];

$class = $_GET['class'];

echo $name; //ravi

echo $class;

Invalid :

$name = $_POST['name'];

echo $name; Undefined Index name Notice Error

$_POST : to receive varible or formdata from POST REQUEST

$_REQUEST : to recive varible from formdata with Any Request $_GET or $_POST

$_Request:: Varible Is indepedent of Request Type or it can handle both the Request GET and POST

$_REQUEST = $_GET + $_POST

?[n>1]+ ?[n=0]


if ?n>=1 get key1 $_GET = $_REQUEST

if ?n=0 POST key1 $_POST = $_REQUEST

Example:

How to send both request : PATCH(update single data) Request or PUT Request (update multiple data)

action = "update.php?id=10"

update <tablename> set name = '$name' where id='$id'; [PATCH]

|               |GET

post

update <tablename> set name = '$name',class = '$class',mobile='$mobile' where id='$id'; [PUT]

How to generate Patch Request and Put Request.

we know that if we want to update and data in the database then we have to

send either put request or patch request.

fully update => [Put] request

partial update => [Patch] request

Query for PUT:

Database Schema

---------------------------

Table : student           |

---------------------------

id|name | class |marks    |

1001|ravi | 12    | 00   |

2002|chavi| 10    | -10  |

---------------------------

update student set marks='100' where id = '1';

Patch Request

Fully update => fully changed in value of auxillary Columns set.

auxillary column set = total columns - (No of Pk Or Composite Key)

if n=3 request Put

if n<3 request patch

In order to sent both the request use ?query string and method = "post"

?query string keyname = which is unique and will not be changed.

?id=1111

post => whose value can be changed name,class,marks

$_SERVER : it is the super global varibale used to get the server configuration

like hostname,host agent, server variables, query string, methods , type

of request,types of headers,..etc,server signature.


How to send request in HTML Form