Retrieving Form Data in PHP

Let's say we have a file form.php, and it contains an HTML form that submits to the page result.php. On this page, we can retrieve the form data using special variables $_GET, $_POST, and $_REQUEST.

These variables contain an array of data from the submitted form. The keys of this array will be the names of the inputs, and the values will be the data that was entered into those inputs.

If the form was submitted using the GET method, then the data will be in the array $_GET, and if it was submitted using the POST method, then the data will be in the array $_POST, respectively. The variable $_REQUEST will contain the form data submitted by any of the methods.