Programming with HTML Forms / Communication Search String Error! | WebReference

Programming with HTML Forms / Communication Search String Error!

Document and Application Communication

Programming with HTML Forms

As mentioned before, when the submit button is clicked, the POST method causes a string to be sent to the application. The string consists of a series of name=value substrings, separated by &'s. An added complication is that name and value are encoded so that spaces are changed into +'s, and some characters are encoded as hexadecimals. Fortunately, form application programmers have written routines for handling these coded strings.

The POST method means that the form application will receive the string on its standard input. This protocol is defined by the Common Gateway Interface (CGI) specification, which also states that an application can respond by generating suitable code on its standard output. Details on the CGI specification can be found at:

The CGI specification permits an application to output many different types of documents (e.g. an image, audio, plain text, HTML, or references to other documents). The application determines the output type by writing a header string to standard output, of the form:

type/subtype must be MIME (Multipurpose Internet Mail Extensions) types; two common ones are text/html for HTML output, and text/plain for ASCII text. There must be a blank line after the header, and then the data can begin. For instance, an application (coded in C) could output the following:

");

This generates the following output:


Search String Error!

Must specify at least 1 pattern.

Figure 1: HTML created by C code


Further reading on CGI programming:

Comments are welcome

Copyright 1996 Andrew Davison and Created: Apr. 26, 1996
Revised: May 7, 1996

URL: https://webreference.com/htmlform/comm.html