DOS-box Executables

The first type of executable that can be run is a DOS program, run in a DOS box by httpd from Windows. The documentation only refers to running batch files with the DOS COMMAND.COM processor but you can run ordinary executables as well.

httpd writes a temporary batch file which sets various environment variables parameters and then calls your DOS executable or batch file. If your form uses the GET method of transferring information, then the whole of the encoded query (eg Name=Chris&Sex=Male&Pound=Sign+%A3) is passed as the first argument to your program. Alternatively if using the POST method then the same information is placed in a temporary file and you are passed its path in the CONTENT_FILE environment variable. I found that I got a sharing exception when I tried to read this file, so we shall pass swiftly on to the Windows Executables, which also nicely decode the form information for you.

However, for those interested, here is a DOS C++ program which does work, although I have had to comment out the part which references the content file, for the above reason. The output is written to the file whose path is in the OUTPUT_FILE environment variable; the required format for this output file is discussed later. The program was compiled with the Zortech C++ 3.1 compiler, but I am sure any other C++ (or C) compiler will work fine.


Return to Web Forms