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



Here's the code that I compiled and ran (after I corrected the typo).
H BNDDIR('CGILIB')

 /INCLUDE XTOOLS/QCPYSRC,CGILIB

DFName            S             10A

DszHeader         C                   'Content-type: text/html\n\n'

DszHtml           S           1000A   VARYING

DnCount           S             10I 0

C*****NOT USED      callp     CGIINIT

C                   EVAL      SZHTML = '<HTML><HEAD><TITLE></TITLE></HEAD>'

**  Could have done this one long statement instead of two EVALs.
C                   EVAL      SZHTML = szHtml+'<BODY>HELLO WORLD!</BODY> +

C                             </HTML>'

 **  Don't really need to use EVAL, could use callp.

C                   EVAL      NCOUNT = cgiStdout(szHeader)

C                   EVAL      NCOUNT = cgiStdout(szHtml)

C                   EVAL      *INLR = *ON

C                   RETURN


-Bob Cozzi
www.RPGxTools.com
RPG xTools - Enjoy programming again.


-----Original Message-----
From: web400-bounces@xxxxxxxxxxxx [mailto:web400-bounces@xxxxxxxxxxxx] On
Behalf Of Bob Cozzi
Sent: Friday, October 07, 2005 3:30 PM
To: 'Web Enabling the AS400 / iSeries'
Subject: RE: [WEB400] cgi issue

Okay, it runs on my machine and I see your coding error.
These lines:
 C                   EVAL      SZHTML = '<HTML><HEAD><TITLE></TITLE></HEAD>'
 C                   EVAL      SZHTML = '<BODY>HELLO WORLD!</BODY> +    
 C                             </HTML>'                                 

You replace the first set of HTML with the second. You really wanted this, I
think:
C                   EVAL      SZHTML = '<HTML><HEAD><TITLE></TITLE></HEAD>'
C                   EVAL      SZHTML = szHtml+'<BODY>HELLO WORLD!</BODY> +

C                             </HTML>'                                 

See it run on my website:  www.rpgiv.com/cgi-bin/tsthtml

-Bob Cozzi
www.RPGxTools.com
RPG xTools - Enjoy programming again.


-----Original Message-----
From: web400-bounces@xxxxxxxxxxxx [mailto:web400-bounces@xxxxxxxxxxxx] On
Behalf Of Douglas W. Palme
Sent: Friday, October 07, 2005 1:51 PM
To: Web400 List
Subject: [WEB400] cgi issue

I think I have the directives issue taken care of, I thought there was some 
major differences between the apache for linux directives and the iseries 
but apparently not.

I have tried to compile a very simple program using Bob Cozzi's cgilib and I

am getting some errors in the job log.

Here is the program as it is currently written:

 H BNDDIR('CGILIB')                                                     
  /INCLUDE XTOOLS/QCPYSRC,CGILIB                                        
 DFNAME            S             10A                                    
 DSZHEADER         C                   'Content-type: text/html\n\n'    
 DSZHTML           S           1000A   VARYING                          
 DNCOUNT           S             10I 0                                  
 C                   callp     CGIINIT()                                
 C                   EVAL      SZHTML = '<HTML><HEAD><TITLE></TITLE></HEAD>'
 C                   EVAL      SZHTML = '<BODY>HELLO WORLD!</BODY> +    
 C                             </HTML>'                                 
 C                   EVAL      NCOUNT = cgiStdout(SZHEADER)             
 C                   EVAL      NCOUNT = cgiStdout(SZHTML)               
 C                   EVAL      *INLR = *ON                              
 C                   RETURN 

I get an internal server error and here is the output from the error Log:

ZSRV_MSG0107: Premature   end of script headers: File name is CGITEST.PGM
CGI PROGRAM /QSYS.LIB/QCGISRC.LIB/CGITEST.PGM RETURNED EXCEPTION ID MCH3401 
SEE JOBLOG FOR JOB 017694/QTMHHTTP  /APACHEDFT

When I try to display the job log with DSPJOBLOG it tells me it can't 
display the log since the job has ended.

Any suggestions would be appreciated.

Douglas


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.