Member ENVVAR in CGICBLDEV2 / HTMLEXAMPL

1.00 
 /$all
2.00 
 Content-type: text/html
3.00 
 Expires: 0
4.00 
 
5.00 
 <HTML>
6.00 
 <HEAD><TITLE>Example of retrieving environment variables</TITLE>
7.00 
 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
8.00 
 <meta name="DOCUMENTCOUNTRYCODE" value="it"/>
9.00 
 <meta name="DOCUMENTLANGUAGECODE" value="it"/>
10.00 
 <style TYPE="text/css">
11.00 
    <!--
12.00 
    .title { color: Blue; font-weight: Bold; font-size: 24pt; font-family: souvenir lt bt, verdana, serif; align: center}
13.00 
    .subtitle { color: black; font-weight: Bold; font-size: 12pt; font-family: souvenir lt bt, verdana, serif; align: center}
14.00 
    .reg {font-size: 10pt; font-family: arial, helvetica, helv}
15.00 
    .mono {font-size: 10pt; font-family: courier}
16.00 
    .bb {font-size: 12pt; color: blue; font-weight: bold; font-family: arial, helvetica, helv}
17.00 
    th {font-size: 10pt; font-family: arial, helvetica, helv}
18.00 
    td {font-size: 10pt; font-family: arial, helvetica, helv}
19.00 
    -->
20.00 
 </style>
21.00 
 
22.00 
 </HEAD>
23.00 
 
24.00 
 <BODY TEXT="black" LINK="blue" VLINK="blue" ALINK="blue" BGCOLOR="white">
25.00 
 
26.00 
 <table width="600">
27.00 
 <tr><td><table width="100%" cellspacing="0" cellpadding="0">
28.00 
         <tr><td valign=top><img src="/cgicbldev2/graphics/pears.gif"
29.00 
                 alt="Giovanni's logo"></td>
30.00 
             <td valign=middle>
31.00 
                 <div class=title>
32.00 
                 Example of retrieving environment variables
33.00 
                 </div>
34.00 
                 </td>
35.00 
             <td valign=middle><img src="/cgicbldev2/graphics/v2.gif"
36.00 
                 alt="this means Version 2">
37.00 
         </td></tr>
38.00 
         <tr><td colspan=3>
39.00 
                 <table width="100%" cellspacing="0" cellpadding="0">
40.00 
                 <tr><td width="100%">
41.00 
                         <img src="/cgicbldev2/graphics/blue.gif" alt="blue line" border="0"
42.00 
                              height="1" width="100%">
43.00 
                         </td></tr>
44.00 
                 <tr><td align="right">
45.00 
                         <font face="verdana,arial,helvetica" size="-1"><b>
46.00 
                         <SCRIPT LANGUAGE="Javascript">
47.00 
                         document.write(getMyDate())
48.00 
                         </SCRIPT>
49.00 
                         </b></font>
50.00 
                         </td></tr>
51.00 
                 </table>
52.00 
                 </td></tr>
53.00 
         </table>
54.00 
         </td></tr>
55.00 
 </table>
56.00 
 
57.00 
 
58.00 
 <TABLE WIDTH=600><TR><TD>
59.00 
 Here are the environment variables from your AS/400 HTTP server, as they are returned to
60.00 
 the CGI program issuing this page.
61.00 
 <BR><BR></TD></TR></TABLE>
62.00 
 <TABLE WIDTH=600 BORDER=1>
63.00 
 <CAPTION>
64.00 
 <I>QtmhGetEnv API</I> provides information about the following
65.00 
 environment variables</CAPTION>
66.00 
 <TH ALIGN=LEFT>Environment variable</TH>
67.00 
 <TH ALIGN=LEFT>Meaning</br>
68.00 
 <font color=blue>Current value</TH>
69.00 
 <TR><TD rowspan=2>AUTH_TYPE</TD>
70.00 
     <TD>
71.00 
     If the server supports client authentication and the script is a
72.00 
     protected script, this environment variable contains the method
73.00 
     that is used to authenticate the client. For example: Basic
74.00 
     </TD></TR>
75.00 
 <tr><TD><font color=blue>/%AUTH_TYPE%/</font></TD></TR>
76.00 
 <TR><TD rowspan=2>CGI_ASCII_CCSID</TD>
77.00 
     <TD>
78.00 
     Contains the ASCII CCSID the server used when converting
79.00 
     CGI input data.  If the server did not perform any conversion,
80.00 
     (for example, in %%BINARY%% mode), the server sets this value to
81.00 
     the DefaultNetCCSID configuration directive value
82.00 
 <tr><TD><font color=blue>/%CGI_ASCII_CCSID%/</font>
83.00 
     </TD></TR>
84.00 
 <TR><TD rowspan=2>CGI_MODE</TD>
85.00 
     <TD>
86.00 
     Contains the CGI conversion mode the server is using for this
87.00 
     request.  Valid values are %%EBCDIC%%, %%MIXED%%, %%BINARY%%, or
88.00 
     %%EBCDIC_JCD%%
89.00 
     (for more information, see
90.00 
     <a href="http://publib.boulder.ibm.com:80/cgi-bin/bookmgr/BOOKS/QB3AEO04/1.1.4.1"
91.00 
     target="_blank">HTTP Server for AS/400 Webmaster's Guide</a>).
92.00 
     The program can use this information to
93.00 
     determine what conversion, if any, was performed by the server
94.00 
     on CGI input data and what format that data is currently in
95.00 
     </TD></TR>
96.00 
 <tr><TD><font color="blue">/%CGI_MODE%/</font>
97.00 
     </TD></TR>
98.00 
 <TR><TD rowspan=2>CGI_EBCDIC_CCSID</TD>
99.00 
     <TD>
100.00 
     Contains the EBCDIC CCSID under which the current server
101.00 
     job is running (DefaultFsCCSID configuration directive). It also
102.00 
     represents the current job CCSID that is used during server
103.00 
     conversion (if any) of CGI input data
104.00 
     </TD></TR>
105.00 
 <tr><TD><font color="blue" size="2">/%CGI_EBCDIC_CCSID%/</font>
106.00 
     </TD></TR>
107.00 
 <TR><TD rowspan=2>CONTENT_LENGTH</TD>
108.00 
     <TD>
109.00 
     When the method of POST is used to send information, this
110.00 
     variable contains the number of characters. Servers typically do
111.00 
     not send an end-of-file flag when they forward the information
112.00 
     by using stdin. If needed, you can use the CONTENT_LENGTH value
113.00 
     to determine the end of the input string.  For example: 7034
114.00 
     </TD></TR>
115.00 
 <tr><TD><font color="blue">/%CONTENT_LENGTH%/</font></TD></TR>
116.00 
 <TR><TD rowspan=2>CONTENT_TYPE</TD>
117.00 
     <TD>
118.00 
     When information is sent with the method of POST, this
119.00 
     variable contains the type of data included. You can create your
120.00 
     own content type in the server configuration file and map it to
121.00 
     a viewer. For example:
122.00 
     Application/x-www-form-urlencoded
123.00 
     </TD></TR>
124.00 
 <tr><td><font color="blue">/%CONTENT_TYPE%/</font></TD></TR>
125.00 
 <TR><TD rowspan=2>GATEWAY_INTERFACE</TD>
126.00 
     <TD>The version of the CGI specification with which the server complies.
127.00 
         Format: CGI/revision</TD>
128.00 
 <tr><TD><font color="blue">/%GATEWAY_INTERFACE%/</font></TD></TR>
129.00 
 <TR><TD rowspan=2>HTTP_ACCEPT</TD>
130.00 
     <TD>MIME content types the browser will accept.</TD>
131.00 
 <tr><TD><font color="blue">/%HTTP_ACCEPT%/</font></TD></TR>
132.00 
 <TR><TD rowspan=2>HTTP_COOKIE</TD>
133.00 
     <TD>All the cookies available to the current page.</TD>
134.00 
 <tr><TD><font color="blue">/%HTTP_COOKIE%/</font></TD></TR>
135.00 
 <TR><TD rowspan=2>HTTP_REFERER</TD>
136.00 
     <TD>Reference to the page or frame the current page or frame was linked from</TD>
137.00 
 <tr><TD WRAP><font color="blue">/%HTTP_REFERER%/</font></TD></TR>
138.00 
 <TR><TD rowspan=2>HTTP_USER_AGENT</TD>
139.00 
     <TD>String identifying the Web client. Includes name and version of the browser, request made through a
140.00 
         proxy, and other information</TD>
141.00 
 <tr><TD><font color="blue">/%HTTP_USER_AGENT%/</font></TD></TR>
142.00 
 <TR><TD rowspan=2>IBM_CCSID_VALUE</TD>
143.00 
     <TD>the CCSID under which the current server job is running</TD>
144.00 
 <tr><TD><font color="blue" size="2">/%IBM_CCSID_VALUE%/</font></TD></TR>
145.00 
 <TR><TD rowspan=2>PATH_INFO</TD>
146.00 
     <TD>The extra path information following the path information required to
147.00 
         identify the CGI program name</TD>
148.00 
 <tr><TD><font color="blue" size="2">/%PATH_INFO%/</font></TD></TR>
149.00 
 <TR><TD rowspan=2>PATH_TRANSLATED</TD>
150.00 
     <TD>The server provides a translated version of PATH_INFO, which takes the
151.00 
         path and does any virtual-to-physical mapping to it</TD>
152.00 
 <tr><TD><font color="blue">/%PATH_TRANSLATED%/</font></TD></TR>
153.00 
 <TR><TD rowspan=2>QUERY_STRING</TD>
154.00 
     <TD>Anything that follows the first ? in the request URL. The string is
155.00 
         encoded in the standard URL format of changing spaces to '+" and
156.00 
         encoding special characters with '%xx' hexadecimal encoding</TD>
157.00 
 <tr><TD><font color="blue" size="2">/%QUERY_STRING%/</font></TD></TR>
158.00 
 <TR><TD rowspan=2>REMOTE_ADDR</TD>
159.00 
     <TD>The IP address of the remote host making the request</TD>
160.00 
 <tr><TD><font color="blue">/%REMOTE_ADDR%/</font></TD></TR>
161.00 
 <TR><TD rowspan=2>REMOTE_HOST</TD>
162.00 
     <TD>The hostname making the request</TD>
163.00 
 <tr><TD><font color="blue">/%REMOTE_HOST%/</font></TD></TR>
164.00 
 <TR><TD rowspan=2>REMOTE_IDENT</TD>
165.00 
     <TD>User ID of the remote user</TD>
166.00 
 <tr><TD><font color="blue">/%REMOTE_IDENT%/</font></TD></TR>
167.00 
 <TR><TD rowspan=2>REQUEST_METHOD</TD>
168.00 
     <TD>The method with which the request was made. For HTTP, this is GET or
169.00 
         POST</TD>
170.00 
 <tr><TD><font color="blue">/%REQUEST_METHOD%/</font></TD></TR>
171.00 
 <TR><TD rowspan=2>REMOTE_USER</TD>
172.00 
     <TD>User name passed for authentication</TD>
173.00 
 <tr><TD><font color="blue">/%REMOTE_USER%/</font></TD></TR>
174.00 
 <TR><TD rowspan=2>SCRIPT_NAME</TD>
175.00 
     <TD>A virtual path to the program being executed, used for
176.00 
         self-referencing URLs</TD>
177.00 
 <tr><TD><font color="blue">/%SCRIPT_NAME%/</font></TD></TR>
178.00 
 <TR><TD rowspan=2>SERVER_NAME</TD>
179.00 
     <TD>The server's hostname, DNS alias, or IP address as it would appear in
180.00 
         self-referencing URLs</TD>
181.00 
 <tr><TD><font color="blue">/%SERVER_NAME%/</font></TD></TR>
182.00 
 <TR><TD rowspan=2>SERVER_PORT</TD>
183.00 
     <TD>The port number to which the request was sent</TD>
184.00 
 <tr><TD><font color="blue">/%SERVER_PORT%/</font></TD></TR>
185.00 
 <TR><TD rowspan=2>SERVER_PROTOCOL</TD>
186.00 
     <TD>The name and revision of the information protocol this request came in
187.00 
         with. Format: protocol/revision</TD>
188.00 
 <tr><TD><font color="blue">/%SERVER_PROTOCOL%/</font></TD></TR>
189.00 
 <TR><TD rowspan=2>SERVER_SOFTWARE</TD>
190.00 
     <TD>The name and version of the information server software answering the
191.00 
         request (and running the gateway). Format: name/version.<br>
192.00 
         For example:<br>IBM-Secure-ICS/AS/400 Secure HTTP Server
193.00 
 <tr><TD><font color="blue">/%SERVER_SOFTWARE%/</font></TD></TR>
194.00 
 </TABLE>
195.00 
 <TABLE WIDTH=600><TR><TD rowspan=2>
196.00 
 <P>Please note that the CGI program issuing this page,
197.00 
 whenever an environment variable value is blank,
198.00 
 will display it as <font color="blue"><i>Not available</i></font>.
199.00 
 </TD></TR></TABLE>
200.00 
 <br><br>
201.00 
 <table width="600">
202.00 
 <tr><td>
203.00 
         <a href="/cgicbldev2p/dspsrc.cgi?srclib=cgicbldev2&srcfile=htmlexampl&srcmbr=envvar"
204.00 
          target="_blank"><b>Display the external html source</b></a></td>
205.00 
     <td align=right>
206.00 
         <a href="/cgicbldev2p/dspsrc.cgi?srclib=cgicbldev2&srcfile=qcbllesrc&srcmbr=envvar"
207.00 
          target="_blank"><b>Display the COBOL source</b></a></td>
208.00 
         </td></tr>
209.00 
 </table>
210.00 
 <br><br>
211.00 
 </BODY>
212.00 
 </HTML>
0.064 sec.s