Repository navigation
Beta1
Pre-releaseCGIHELPER *SRVPGM
An IBM i *SRVPGM that contains RPG IV compatible procedures to do basic CGI programming. This is a lightweight version that can read HTML form data from the browser and write HTML to the browser. From example to send data to the web browser you might do something like this:cgi_stdout('<p>Hello World</p>\n');
This writes the HTML paragraph with "Hello World" to the browser.
The '\n' symbol at the end of the output string is a supported symbolic version of the ASCII LINEFEED symbol. This allows you to embed linefeeds wherever and whenever you want. You don't have to worry about specifying the (often wrong) character as a Linefeed, or using complex concatenation logic to build your strings just to embed a linefeed. Simply type \n.
This version is the initial beta version but it is being used daily in production-level applications.
To install it, just download the attached save file (below) and upload it to your IBM i server, then issue the RSTLIB command.
RSTLIB SAVLIB(CGIHELPER) DEV(*SAVF) SAVF(QGPL/CGIHELPER) MBROPT(*ALL) ALWOBJDIF(*ALL)
The ALWOBJDIF and MBROPT parameters are obviously not needed the first time you restore the library, but may be important on future updates.
NOTE: While we've pretty much hardened up the parameters and procedure names, we may need to change them before the final beta or first production version is released. As unlikely as that is, be prepared in case that does happen.
Source Code and Build Routine
This beta includes the full source code. The service program is written entirely in RPG IV free format syntax and it may be created (unix nerds call it "make") by running the included BLDCGIHELP CL command (source for it is also included)..
For example: To build the CGIHELPER *SRVPGM object on your system you would run the following command:
CGIHELPER/BLDCGIHELP
A prompted version is supported and there are source lib, object lib and debug options. You can compile it into a different library if you'd like, if you do, however, you may need to do something with the /copy source members (i.e., /INCLUDE source member syntax) and the BNDDIR keyword on the included /include CGIHEADER member.