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




Thanks Aaron, that did it. I had read on a website that one needed a blank line before and after the /&Header and so on. Guess not...

Kelley

On 11/10/2010 4:37 PM, Aaron Bartell wrote:
Try changing your header area to this:

/$Header
Content-type: text/html


<html>
....

Also, you can check out www.OpenRPGUI.com as an alternative. Note it
doesn't have the same amount of following of CGIDEV2 (yet :-).

Aaron Bartell
http://mowyourlawn.com
http://mowyourlawn.com/blog/


On Wed, Nov 10, 2010 at 4:02 PM, Kelley Shaddrick<
kshaddrick@xxxxxxxxxxxxxxxx> wrote:

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
--
This is the RPG programming on the IBM i / System i (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.





No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 8.5.449 / Virus Database: 271.1.1/3248 - Release Date: 11/10/10 07:34:00



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.