× 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.



Ah, you know you've got the "name" form field spelled wrong, right?

<INPUT TYPE=TEXT NAME="yrname">
Is not the same as...
  name = zhbgetvar('name'); 

-Bob Cozzi


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]
On Behalf Of Ricky Thompson
Sent: Monday, November 15, 2004 4:04 PM
To: rpg400-l@xxxxxxxxxxxx
Subject: CGIDEV2 question

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>                       
  &nbsp;&nbsp;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>                                                                

--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.