iTP Secure WebServer System Administrator's Guide (iTPWebSvr 6.0+)
Using Common Gateway Interface (CGI) Programs
iTP Secure WebServer System Administrator’s Guide—523346-002
8-35
Examples of a Pathway CGI Implementation
Examples of a Pathway CGI Implementation
Example 8-3 shows you how a CGI program may be written as a Pathway server
class.
Example 8-3. Sample Pathway CGI Program (page 1 of 3)
/*
This is a simple little test program that demonstrates how to
write a CGI routine as a Pathway Server Class.
This routine assumes that the forms data has been put into
the standard environment. The "Region" command that should
be used is:
Region /* {
AddCGI AUTOMATIC_FORM_DECODING ON
}
To retreive the value of the following filled out form entry:
<INPUT SIZE=30 NAME="First_Name" > <b>Your First Name</b> <br>"
Use:
getenv("First_Name");
OR
Region /* {
AddCGI AUTOMATIC_FORM_DECODING ON
AddCGI FORM_DECODING_PREFIX
your_prefix_
}
To retrieve the value of the following filled out form entry:
<INPUT SIZE=30 NAME="First_Name" > <b>Your First Name</b> <br>"
Use:
getenv("your_prefix_First_Name");
In the first example the environment variables will be made with the same
names as the name portion of the name value pair.
In the second example the names of all decoded from are prefixed with the
prefix "your_prefix_".
Using the prefix option can be useful if you expect duplication of names on
your form with default CGI parameters.
*/