The [CGI] section contains all the Common Gateway Interface variables. Note that for DOS executables, these are passed as environment variables to the program. The Logical Path and Query String are the most immediately useful variables, as discussed earlier. I found that both DOS and Windows programs did not receive any of the authentication variables.
[Accept] lists the MIME types that the user's browser can accept, for example audio/wav=Yes. I presume that the entry */*=YES at the end of list provided by httpd means that you can send any type. However, note carefully that you have to set up httpd's MIME types file in order to be able to send different file types successfully.
The [System] section has a copy of the Output File path and the Content File path.
[Extra Headers] lists extra information that was provided with the request, eg User Agent=whatever.
In the example code, the GetFormValue() searches for a key in one of these sections. It always returns a huge pointer to retrieved value (even if the string is small). ReadBuf() is used to read data from a file - this copes with reading huge amounts of data. For [Form Huge] keys, DecodeValue() is called to decode the raw value string. For debugging purposes, EnumerateFormKeys() simply lists the available keys as HTML to the output file. EnumerateKeys() lists the Query String and Logical Path variables and calls EnumerateFormKeys() for each of the three [form] sections.
To return HTML, you would write just one header line containing "Content-type: text/html"; the data would be the HTML that you want displayed. Optionally you can include a Status: special header, but httpd assumes a "200 OK" status if it is not given.
If your special header line is "Location: url" then the given URL is displayed instead.
Finally, you can return HTTP data directly to the browser, though this is not for the faint- hearted. You may have to begin your executable's name with "nph-" to make httpd realise that it should not package the data. Here is some example direct data:
HTTP/1.0 200 OK Date: Wednesday, 26-Oct-94, 14:05:30 GMT Server: NCSA/V1.3Pre/MSWin Content-type: text/html Last-modified: Wednesday, 26-Oct-94, 14:05:30 GMT Content-length: 1123 <HTML> ... </HTML>You should be able to return other data types apart from HTML, but my brief attempts to do so have not worked.