Provide an html form through which a customer could register.
See our example.
- The customer file is
in your library
look at its DDS.
Perform as follow:
- Signon on AS/400 as QPGMR
- Develop your skeleton html member
on source file
and add member
- 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
- 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
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
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
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
Html tags to be used are
- <select name=xctrnam>
- <option value selected>country_name