CGIForm.pas
What is CGIForm?
This program is an example of how to process forms using Irie Pascal CGI programs. A
full listing of this program is not given on this page, because it would be too long.
However partial program listings are given below, where they may be useful. You can
download the full source code for this program, using the download links at the bottom of
this page.
What does CGIForm do?
The program retrieves any form data passed to it. If the program has received form data
then it just displayed this form data along with a link back to itself. If the program has
not received any form data then it displays a form to accept input from the user and send
this form data back to itself.
How does CGIForm work?
The program executes the following statements:
begin
Initialize;
GetCGIData;
ProcessCGIData;
GenerateResponse;
Shutdown;
end.
Initialize
This procedure initializes the program.
GetCGIData
This procedure retrieves any form data passed to the program. The form data is stored
in a global buffer.
ProcessCGIData
This procedure reads the form data in the global buffer (if any is there), and
seperates the data into name/value pairs and stores them in a global list.
GenerateResponse
This procedure generates the response and writes it to the standard output stream. The
exact response depends on whether any form data was passed to the program. If form data
was passed to this program then the previous procedure would have placed it into the
global list and this procedure will generates a response that displays the form data. If
form data was not passed to this program then the global list will be empty and this
procedure will generates a repsonse that contains a form to accept user input.
Shutdown
This procedure disposes of the global list.
Run CGIForm
CGIForm has been compiled and installed on this server. To see it run, click here.
Download CGIForm
Source code: cgiform.pas (size=11,347 bytes)
If you are using the Irie Pascal IDE (available only in the Windows edition) then you
might also want to download the IDE project file: cgiform.ipj
(size=1,762 bytes)
Next > CGICook |