× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



OK Diane, If I unserstand you correctly, you want to display a web page to a
user so they can input a year and term to print a report of some kind..Here
is the source that I come up with...

Statis HTML source displaying to text boxes.....year....term...The user will
enter the year and term.....When the user presses the submit button.....the
year and term are passses into DIANE2 program were you will then parm them
to a CL...
<html>
<head>
<title>Justin's CGI to CL Test Program
</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<form name="form1" method="post" action="/cgi-bin/diane2">
  <p> Enter Year
    <input type="text" name="year">
  </p>
  <p> Enter Term
    <input type="text" name="term">
    <input type="submit" name="Submit" value="Submit">
    Pressing Submit will call the report cl program and print the report to
Diane's
    Printer</p>
</form>
</body>
</html>

Here is the RPG....
 0001.00  *Copy in common stuff
0002.00  /copy jcopysrc,hspecs
0002.00 /copy jcopysrc,hspecsbnd
0003.00  /copy jcopysrc,prototypeb
0004.00  /copy jcopysrc,usec
0005.00  /copy jcopysrc,variables3
0006.00  *
0007.00  *setup stand alone fields
0008.00 D year            S              4A
0009.00 D term            S              2A
0010.00  *
0011.00  *receive input from browser
0012.00  /copy jcopysrc,prolog3
0013.00  *
0014.00  *Setup debug
0015.00 C                   CallP     wrtjobdbg(*on)
0016.00 C                   CallP     SetNoDebug(*off)
0017.00  *
0018.00  *Read output skeleton html from IFS into memory
0019.00 C                   CallP     GetHtmlIfs('/rtekweb/cgihtmlsrc/+
0020.00 C                             diane2response.htm')
0021.00  *
0022.00  *Parse varibles from the input stream
0023.00 C                   Eval      year = zhbgetvar('year')
0024.00 C                   Eval      term = zhbgetvar('term')
0025.00  *
0026.00  *Call the report cl program
0027.00  *
0028.00 C*--->              CallB     'report'
0029.00 C*--->              Parm                    year
0030.00 C*--->              Parm                    term
0031.00  *
0032.00  *Write the Response HTMl to browser so user knows the report
printed
0033.00 C                   CallP     WrtSection('response')
0034.00 C                   CallP     WrtSection('*fini')
0035.00  *
0036.00  *End the program
0037.00 C                   Eval      *inlr = *on

Here is the resonse HTML source....this will let the user know the report
has been printed...stick this source in you IFS and make the approiate
changes to line 19 and 20 in the RPG source.

/$response
<html>
<head>
<title>Justin's Report Response Page</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body bgcolor="#FFFFFF" text="#000000">
<font face="Times New Roman, Times, serif" color="#00FF40">Your Report Has
Printed
to Diane's Computer!!!!!</font>
</body>
</html>


Feel free to e-mail if you have any problems!!!!














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


> No Error Message this time. After hitting submit. It just hangs. It
doesn't go back into
> the program. I get this and that's it.
> Diane
>
> http://lccc/tcgi-bin/cgidiane4?year=2001&term=43
>
> Message: 5
> Date: Wed, 15 May 2002 10:12:10 -0500
> From: Justin Houchin <jhouchin9@charter.net>
> Subject: Re: [WEB400] Different Approach
> To: web400@midrange.com
> Reply-To: web400@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-2024 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.