|
I'm playing around with the CGIDEV2. I am trying to write a CGI program. I was trying to make whole program contained inside one program. So I have a HTML file that displays the question what is your name. Basically you just call http://....../cgi-bin/yourname.pgm and it displays the html. But then I want it to display the results of the variable name if they are not equal to blanks. But for some reason when I do the name = zhbgetvar('name') and request = zhbgetvar('request') it always returns blanks. Other examples that are similar that came with CGIDEV2 seem to work but my example always returns blanks in both the name field and the request field. I'm even printing it out to make sure. Thanks in advance... /copy cgidev2/qrpglesrc,hspecs /copy cgidev2/qrpglesrc,hspecsbnd FQSYSPRT O F 132 PRINTER /copy cgidev2/qrpglesrc,prototypeb /copy cgidev2/qrpglesrc,usec /copy CGIDEV2/qrpglesrc,variables3 D request S 2a D name S 20a /copy CGIDEV2/qrpglesrc,prolog3 /free clrhtmlBuffer(); gethtml('QHTMLSRC':'CGILIB':'YOURNAME'); request = zhbgetvar('request'); name = zhbgetvar('name'); except error; if name <> ' '; updHTMLvar('name': name); wrtsection('result'); else; wrtsection('start'); endif; wrtsection('*fini'); *INLR = *ON; /end-free ORMSPRT04 E error 1 O 'Request = ' O request ORMSPRT04 E error 1 O 'Name = ' O name --------HTML file--------- /$start <html> <head> <title>Enter Your Name</title> </head> <body topmargin=0 bottommargin=0 leftmargin=0 rightmargin=0> <table> <tr> <td><h1>Your Name</h1></td> </tr> </table> <form method=get action="/cgi-bin/yourname.pgm"> <INPUT type=hidden name=request value=go> Enter Your Name <INPUT TYPE=TEXT NAME="yrname"> <INPUT TYPE="submit" VALUE="Enter"> </form> /$result <table> <tr> <td><h1>Your Name is /%name%/</h1></td> </tr> </table> </body> </html>
As an Amazon Associate we earn from qualifying purchases.
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.