The following CGI program assumes that the user has been asked to enter his or her name, and that the entered name is stored in the CGI variable "username". This can be accomplished using the following HTML form:
<body> <form action="/cgi-bin/simple.acu" method="get"> Please enter your name or leave blank for "anonymous": <input type="text" name="username" size=60> <input type="submit" value="Submit"> </form> </body>
This program also uses an HTML template, "greeting.html". Here is an example:
<body> Hello %%username%% This Web page is still under construction. Please try again in a few days. </body>
The CGI program then, is as follows:
identification division. program-id. simple. remarks. data division. working-storage section. 01 input-output-form is external-form is identified by "greeting". 03 user-name pic x(60) identified by "username". procedure division. main-logic. accept input-output-form. display input-output-form.