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



Howdy folks,

I've started working with serving web pages from RPG. I started with a very nice tutorial showing how to use the QtmhWrStout API, very easy and produced a basic web page on the first try. However, it limits web page size to the size of the API variable. So, moving on to newer methods I've been working with CGIDEV2 for a couple of days now. Unlike the first method, I've had absolutely no success producing a simple web page with CGIDEV2.

After resolving countless errors (thanks to all those who encountered them long before I did and offered solutions on various websites!), I now get no errors in any log but still no web page is displayed. When I try to run the program via the browser, I get the opening program dialog box with the browser asking me what I want to do with this program. I suspect that I don't have something configured correctly, but frankly don't know what. Any advice on how to proceed would be greatly appreciated.

The RPG is compiled into a library called CGILIB. The HTML is in a folder off the root called /html. It's supposed to display a list of my customer master file. Here is the HTML file and the corresponding RPG file (I took comments and such out to save space):

**********

/$Header

content-type: text/html

<html>

<head>
<title>My Customer List</title>
</head>

<body>
<h1>My Customer List</h1>
<table border="1">

/$List

<tr>
<td>/%Cmcomp%/</td>
<td>/%Cmcust%/</td>
<td>/%Cmname%/</td>
</tr>

/$Footer

</table>
</body>
</html>


**********

H DftActGrp(*no) ActGrp('QILE')
H Option(*nodebugio: *seclvl: *srcstmt: *xref)

D/copy cgidev2/qrpglesrc,hspecsbnd


FCstmas if e k disk usropn

D/copy cgidev2/qrpglesrc,prototypeb
D/copy cgidev2/qrpglesrc,usec

/free

setnodebug(*off);

gethtmlIFS('/html/cstmas.html':'/$');

wrtsection('Header');

open Cstmas;

setll *start Cstmas;
read Cstmas;

dow not %eof(Cstmas);

updHtmlVar('Cmcomp': %char(Cmcomp));
updHtmlVar('Cmcust': %char(Cmcust));
updHtmlVar('Cmname': Cmname);

wrtsection('List');

read Cstmas;

enddo;

close Cstmas;

wrtsection('Footer');
wrtsection('*fini');

eval *inlr = *on;

/end-free

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.