<PRE>
Enter Password
<input type="password" name="pword" size=10 maxlength=10>
</PRE>
<P>
<H3>Hidden Field</H3>
<P>
<input type="hidden" name="hidden" value="Text not shown on form...">
<P>
<PRE>
<input type="submit" name="pushbutton" value="Apply">
<input type="reset" name="pushbutton" value="Reset">
<HR>
</PRE>
</FORM>
</BODY>
</HTML>
Sending Information to the Server
When you fill out a form, the web browser sends the request to the server in a
format that is described as URL-encoded. The web browser also performs this
function whenever you enter a phrase in a search field and click on the submission
button. In URL-encoded information:
vThe URL starts with the URL of the processing program.
vA question mark (?) precedes attached data, such as name=value information
from a form, which the system appends to the URL.
vA plus sign (+) represents spaces.
vA percent sign (%) that is followed by the American National Standard Code for
Information Interchange (ASCII) hexadecimal equivalent of the symbol
represents special characters, such as a period (.) or slash (/).
vAn ampersand (&) separates fields and sends multiple values for a field such as
check boxes.
Note: The method attribute specifies how the server sends the form information to
the program. You use the GET and POST methods in the HTMLfile to
process forms. The GET method sends the information through environment
variables. You will see the information in the URLafter the ?character.
The POST method passes the data through standard input.
The main advantage of using the GET method is that you can access the
CGI program with a query without using a form. In other words, you can
create canned queries that pass parameters to the program. For example, if
you want to send the previous query to the program directly,you can do
the following:
<A HREF="/cgi-bin/program.pgm?Name=John&LName=Richard&user=Smith%Company=IBM">
YourCGI Program</a>
The main advantage to the POST method is that the query length can be
unlimited so you do not have to worry about the client or server truncating
data. The query string of the GET method cannot exceed 4 KB.
Data Conversions on CGI Input and Output
The server can perform ASCII to EBCDIC conversions before sending data to CGI
programs. This is because the Internet is an ASCII world and the AS/400 is
primarily an extended binary-coded decimal interchange code (EBCDIC) world.
The server can also perform EBCDIC to ASCII conversions before sending data
Chapter1. Writing Common Gateway Interface Programs 5