Standard Input

Standard input is used for getting the user's data when forms are submitted with the "POST" method [ <FORM METHOD=post ...> ]. This means that the form data is in a specific format, being both URL-encoded and in an encoded representation [what I've called the Form-Data Format; see the section called Form-Data Format]. The data is waiting on standard input for the program to read and process. This data is not EOF-terminated, and the CONTENT_LENGTH environment variable must be used to determine the end of input [see the section called Environment Variables].

The nature of URL-encoding removes all spaces, so the data waiting on standard input is a single string in the format specified below [see the section called Form-Data Format]. This data must be read, decoded and parsed by the CGI program, but it's usually easier to use a pre-written library to do these steps than to re-write this tedious [and error-prone] processing for each CGI program. For perl, the cgi-lib.pl library is very useful [see cgi-lib.pl].