|
|
An Introduction to CGI - The Common Gateway Interface
by Jay Eckles
Input
When your CGI gateway program is initiated, it will receive its input
in one of two ways, depending on the request method that was used
leading to the execution of the CGI program. In methods like POST,
where the information is attached after the HTTP header, the information
will be sent to the program on stdin. In methods like GET, where the
information is contained within the HTTP header, the input is sent to
the program through the environment variable QUERY_STRING. In any case,
information about the input is sent to the program through environment
variables. The variable CONTENT_LENGTH gives the length (in bytes) of
the content given by the client. The variable CONTENT_TYPE indicates
the type of content given by the client; if the client submitted the
results of a form, for example, the content type would be
application/x-www-form-urlencoded.
[Contents] [Next] [Previous]
If you have any questions or would like to contact me for any reason, please email me at j.eckles@computer.org.
|