Objective
Provide an html form through which a customer could register.
Example
See our example.
Resources
- The customer file is
CUS01
in your library
CENTAUR2
.
Please
look at its DDS.
Perform as follow:
- Signon on AS/400 as QPGMR
- Develop your skeleton html member
- strpdm
on source file
mycgilib/htmlsrc
and add member
lab31a,
source type
html
- Write the following html sections
- section top starts the html
- section form displays the input form
to be filled in
- section done congratulates the customer
for having registered
- Develop your ILE-RPG CGI program
- Enter command
cgidev2/crtcgisrc srcmbr(lab31a) srclib(mycgilib) option(3)
to create the default ILE-RPG module source for this program
in
mysrclib/qrpglesrc
- Complete this source.
- Your program should be able to handle two situations:
- issue the form
- receive data from the form,
register the customer data,
and send a response to the remote browser.
- compile the module
- create the CGI program
- to test your CGI program,
in the command line of your internet browser
enter
http://.../mysrclibp/lab31a.pgm
First upgrade
Your program should check that all input fields
are filled in. If some input fields are not filled in,
your program should
- issue and error message (section)
- trasmit back the inputs received, so that the
user doesn't have to re-key in all the data
- signal with an appropriate color (for instance, red)
the field(s) with data missing
Second upgrade
In the real life, you would assist your end-user
by letting him select a country out of a list of countries,
instead of letting him key in the name of his country.
This is done through a selection list.
Your next upgrade would be exactly this one.
- Input to your selection list is file
centaur2/countries.
You may
browse its DDS.
- For the country, instead of an input field type=text,
insert a selection list, in the same way as you did for
the table-subfile.
Html tags to be used are
- <select name=xctrnam>
- <option value selected>country_name
- </select>
Lab solutions
Type |
Run it |
html |
rpg |
Basic |
X |
X |
X |
First upgrade |
X |
X |
X |
Second upgrade |
X |
X |
X |
|