The OWTCGIEnv class provides a simple interface to access the CGI FORM parameters and CGI environment variables. It handles both POST and GET methods, etc.
The class automatically handles the parsing or the QUERY data. The object is ready to use as soon as it is created, but the actual parsing happens only the first time you attemps to access one of the form parameter values.
You will usually create an instance of a OWTCGIEnv object at the beginning of the main() function of your application, and the object destructor will automatically take care of cleaning up any resources used by the object when the main() function exits.
Returns the value for a given form parameter or "" if no value exists for this parameter.
This function is guaranteed to never return NULL, and the caller should not attempt to free or modify the returned string.
Same as GetFormParam(), but returns a StringList of values with one entry for each value taken by the specified parameter. This method should be used for multiple selection lists.
The returned StringList should be eventually freed using DestroyStringList().
This is just a safe version of the system getenv() that is guaranteed to never return NULL. If the specified variable value does not exist then it returns "".
The caller should not attempt to free or modify the returned string.
The OWTCGIEnv class should be sufficient to satisfy most application needs. If you need a more complete CGI interface, you have the choice of either improving the OWTCGIEnv class, or turning to another (more complete) CGI interface available in source form.
You can have a look at: