×

Good News Everybody!

The new search engine is LIVE!

Please report any problems to david (at) midrange.com.




Is the program running correctly but you receive an HTTP500 error on the
browser?


----- Original Message -----
From: "Diane Nott" <dnott@lorainccc.edu>
To: <web400@midrange.com>
Sent: Wednesday, May 15, 2002 9:02 AM
Subject: [WEB400] Different Approach


> Hi. I am trying a different approach. Right now I am trying to get the
input
> variables and write them to the browser so I can see them. The input part
works fine
> but I can't see any output. What am I doing wrong. My ultimate going is to
transfer
> the input variables into a CL program. Can I do it with this program?
> Thanks!
> Diane
> Here is what I am doing:
>
> *=====================================================================
>       /copy diane/qrpglesrc,hspecs
>       /copy diane/qrpglesrc,hspecsbnd
> *=====================================================================
>       * Includes to be used in CGIs
>  *=====================================================================
>       /copy diane/qrpglesrc,prototypeb
>       /copy diane/qrpglesrc,usec
>       /copy diane/qrpglesrc,variables3
>
*=====================================================================
>       * Variables specific to this module
> *=====================================================================
>       * Name of this program
>      D PgmName         c                   'cgidiane4'
>       * Path to this program
>      D PgmPath         c                   'tcgi-bin'
>       *
>       * Sample client input variables
>      D year            s              4a
>      D term            s              2a
>       *
> *=====================================================================
>       * Read remote browser request via "zhbGetInput" procedure
> *=====================================================================
>       /copy diane/qrpglesrc,prolog3
> *=====================================================================
>       * Main line
> *=====================================================================
>       * Write qualified job name to debug file.  The *on
>       * parameter forces output even if debugging is off.
>       * Remove this parameter or change it to *off if you
>       * want the output only if debugging is on.
>      C                   callp      wrtjobdbg(*on)
>      C                   CallP     SetNoDebug(*on)
>       *------------------
>       * Ask the service program to load into core
>       * html member  CGIFORM
>       * from source file HTMLSRC in library DIANE
>      C                   callp     gethtml('HTMLSRC':
>      C                             'DIANE':'CGIFORM')
>       * Use "zhbGetVar" procedure
>       *  to parse the input string into program variables
>      C                   eval      year     = zhbgetvar('year')
>      C                   eval      term     = zhbgetvar('term')
>       * Start the output HTML:
>       *   clear all variables and set variable "/%pgm%/"
>       *                  callp     updHTMLvar('pgm':PgmName:'0')
>       *Write the TOP
>      C                   callp     wrtsection('top')
>       *Write the HTML Header
>      C                   callp     wrtsection('tablestart')
>       *Write the Table Header
>      C                   callp     wrtsection('tablerow')
>       **Update html skeleton buffer with values
>      C                   callp     updHTMLvar('year':year)
>      C                   callp     updHTMLvar('term':term)
>       *Write the Table Row
>      C                   callp     wrtsection('tablerow')
>       *Write Table End
>      C                   callp     wrtsection('tableend')
>       *Write HTML End
>      C                   callp     wrtsection('end')
> *=====================================================================
>       * Send response html and quit
> *=====================================================================
>       * End the HTML
>       * Do not delete the call to wrtsection with section name *fini.  It
is needed
>       * to ensure that all output html that has been buffered gets output.
>       * Quit without raising *inlr
>      C                   callp     wrtsection('*fini')
>      C                   eval      *inlr=*on
>      C                   return
>       *End of Program
>
> HTML I am using:
> /$top              **** START HTML
> Content-type: text/html
>
> <html>
> <head><title>Registration Counts Program "/%pgm%/"</title></head>
> <style type="text/css">
> .title { font-family:  Arial, sans-serif; font-weight: normal; font-size:
24px; }
> .subtitle { font-family:  Arial, sans-serif; font-weight: normal;
font-size: 18px;
> color: blue; }
> .warnred { color: red; font-weight: Bold; font-size: 18pt; font-family:
souvenir lt
> bt, verdana, serif; }
> .warnblue { color: blue; font-weight: Bold; font-size: 18pt; font-family:
souvenir
> lt bt, verdana, serif; }
> .mono { font-family: courier; font-size: 78%; }
> td,th,caption { font-family: Arial, sans-serif; font-size: 85%; }
> </style>
> </head>
>
> <body TEXT="#000000" LINK="#FF0000" VLINK="#BD3000" ALINK="#BD9CF7"
> BGCOLOR="#FFFFFF">
>
> <div class=title>Registration Counts Program "/%pgm%/"</div>
> <br><br>
> /$tablestart        **** START TABLE
> <table border=0 cellspacing=5>
> <th>Year</th>
> <th>Term</th>
>
> /$tablerow          **** TABLE ROW
> <tr><td class=mono align=right>
>         /%year%/
>         </td>
>     <td>/%term%/</td>
>         </td></tr>
>
> /$tableend          **** END TABLE (SOME RECORDS IN FILE)
> </table>
>
> /$form              **** INPUT FORM
> <form action="//%pgmpath%///%pgm%/" method=GET>
> <table border=0>
> <tr><td colspan=3 class=subtitle>
>         Add the Year and Term:
>         </td></tr>
> <tr><td>YEAR:</td>
>     <td class=mono colspan=2>
>         <input type=text name=year value="/%year%/"
>          size=4 maxlength=4>
>         </td></tr>
> <tr><td>TERM:</td>
>     <td class=mono colspan=2>
>         <input type=text name=term value="/%term%/"
>          size=2 maxlength=2>
> <tr><td colspan=3 align=center>
>         <input type=submit value="Send">
>         <input type="reset"  value="Start Over">
>         </td></tr>
> </table>
> </form>
>
> /$end               **** END HTML
> <br><br>
> </body></html>
>
> _______________________________________________
> This is the Web Enabling the AS400 / iSeries (WEB400) mailing list
> To post a message email: WEB400@midrange.com
> To subscribe, unsubscribe, or change list options,
> visit: http://lists.midrange.com/cgi-bin/listinfo/web400
> or email: WEB400-request@midrange.com
> Before posting, please take a moment to review the archives
> at http://archive.midrange.com/web400.
>




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2026 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.