Forms are essential to any Web page that communicates with users. When you enter the information in the form and click on the submit button, the browser URL encodes and sends it to the server for processing. PHP will decode and process the information according to the instructions in the PHP program that gets it.
Working with forms is a two-step process:
When the browser requests a Web page from the server, it establishes a TCP/IP connection and send s a request in an HTTP format. The server examines the request and responds.
HTTP is a "stateless" protocol - it has no built-in mechanism that helps you to save information from one page so you can access it in other pages.Whenever PHP processes a page, it checks for URL and form variables, uploaded files, applicable cookies, and Web server and environment variables. These are then directly accessible in the following arrays: $_GET, $_POST, $_FILES, $_COOKIE, $_SERVER, and $_ENV. They hold, respectively, all variables set in the query string, in the body of a post request, by uploaded files, by cookies, by Web server, and by the environment in which the Web server is running. There's also $_REQUEST, which is one giant array that contains the values from the other six arrays.