ABSTRACT

Hypertext Markup Language (HTML) provides a complete set of form and input elements to obtain user input and upload data, including files, to the server. This chapter introduces form processing using PHP. PHP is a very powerful and popular language especially designed for server-side scripting on the Web. The PHP interpreter works especially well with the Apache Web server as a built-in server module. The HTML fill-out form processing involves three phases: collecting user input, sending Hypertext Transfer Protocol (HTTP) queries, and server-side processing. Input-control elements may also be placed outside a form for other purposes such as interactions with client-side JavaScript. The form attribute method indicates the HTTP method post or get, action specifies the server-side program, and enctype sets the way data are encoded. To understand formdata submission by a browser and form processing on the server side, it is necessary to have some basic ideas about the HTTP protocol.