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



You can read about CGILIB in the powerpoint I've posted online at:
http://www.rpgxtools.com/xTools%20CGILIB%20Overview.mht
Included near the end of the presentation is a cross reference of CGIDEV2 to
CGILIB functions.
In a nutshell:
CGILIB is pretty much a plug-in replacement for CGIDEV2.
Benefits, well most a subjective, but I have updated all my CGI program by
replacing the CGIDEV2 procedure calls with CGILIB calls. It was literally a
find/replace in SEU task.
The things I like best are that the tool is more streamlined. It doesn't
require the 3 or 4 /COPY statements to make it work. Once /COPY for the
prototypes, then call the cgiInit() procedure. In fact, if you forget to
call cgiInit(), most of the other cgi procs check for it, and if you haven't
called it, will call it for you.
Aside from that, there are several more functions in the CGILIB service
program, including:
Interpretation of the '\n' character (so you don't need to concatenate
X'25').
Ability to use CGIDEV2-like HTML or raw/traditional CGI/HTML right in your
code. That is there is a cgiStdOut() procedure that sends data to the
browser directly.
CGILIB checks the HTML when you call the final cgiWrtSection('*fini')
routine. If "Content-type" is not the first line of HTML, it inserts it for
you.

The biggest thing, however, is that you can use your already written HTML
with CGIDEV2 sections and token IDs, with CGILIB--no changes required. In
fact, one developer on my system still has some CGIDEV2 stuff. I also use
the same HTML files as he does, and he uses CGIDEV2, while I use CGILIB. It
is _that_ compatible.

Above and beyond CGIDEV2, the CGILIB has been optimized over and over to try
to minimize certain tasks. CGILIB does not have any practical limits as far
as the number of sections in an HTML file or the number of field tokens.
Also, CGILIB does not output "***missing data***" when you avoid writing out
a field token--a feature I sorely wanted. In addition, I have analyzied the
QzhbCGIParse API, which is used by zhbGetVar in CGIDEV2 and by cgiGetvar()
in CGILIB. CGIDEV2 retrieves all form fields and stores them and sorts them
in memory. It was determined that this step adds unnecessary overhead and is
avoided by CGILIB. 

There are a few things in CGIDEV2 that are not in CGILIB. The web server
configuration statements are not inserted with CGILIB, you have to do that.
Also the routine that builds a <SELECT><OPTION> tag set is not in CGILIB.
CGILIB includes a few things not in CGIDEV2, such as cgiLineFeed() which is
a procedure that scans an HTML string for embedded \n symbols and replaces
them with X'25'. cgiObfuscate() which is a procedure that takes email
addresses and Obfuscates them for output to the HTML so that email sniffers
can't see the addresses. cgiSndMsgID() is a procedure that will allow you to
create an entire HTML page from a raw CPF message ID. You 'send a message'
that goes to the webpage, the page is dynamically created and sent to the
user. Then there's cgiFmtMsgID that simply returns the HTML so that you can
embed it in your own web page. UnEscape() which unescapes a URL encoded
string, and on and on.
Again, for more info you can look at the PowerPoint I put together on it at
the www.rpgxtools.com website.
-Bob Cozzi


-----Original Message-----
From: web400-bounces@xxxxxxxxxxxx [mailto:web400-bounces@xxxxxxxxxxxx] On
Behalf Of Mike Skvarenina
Sent: Thursday, October 21, 2004 9:33 PM
To: 'Web Enabling the AS400 / iSeries'
Subject: RE: [WEB400] Browser tries to download program

Bob,

Can you elaborate on what CGILIB is?  I though earlier you were simply
referring to a library name on your iSeries but now it sounds like
you've created a tool similar to CGIDEV2.  If true, can you compare and
contrast the 2?

Finally, any additional thoughts on my problem?  My previous HTML didn't
have a content type section.  I don't know how that would effect the web
server itself as opposed to the browser.  For example does the web
server itself read the HTML then do something different/special when it
sees a content type directive?



-----Original Message-----
From: web400-bounces+mskvarenina=usa.net@xxxxxxxxxxxx
[mailto:web400-bounces+mskvarenina=usa.net@xxxxxxxxxxxx] On Behalf Of
Bob Cozzi
Sent: Thursday, October 21, 2004 3:50 PM
To: 'Web Enabling the AS400 / iSeries'
Subject: RE: [WEB400] Browser tries to download program

Yes, that's why I wrote CGILIB with the xTools. It doesn't have the
scaling
limitations that CGIDEV2 had. As long as you stay under 16MB of HTML
being
sent at once, there are no practical limitations. I do limit the section
names to either 32 or 64 characters (can't remember which it is at the
moment), but you can have as many of them as you want.
I would like to hear more about your "conditional sections" including
what
you use them for, and how you use them. Perhaps offline would be better
if
others aren't interested.
As to your 1993... that's perfect. In my CGI RPG classes, I have a line
that
I often use:  "Many long-time HTML coders, and by long-time, I mean
someone
who started using HTML before 1997... seem to prefer Windows Notepad as
their HTML editor of choice."  That line usually gets a good laugh, but
as
you have indicated... there's some truth to it.  
-Bob


-----Original Message-----
From: web400-bounces@xxxxxxxxxxxx [mailto:web400-bounces@xxxxxxxxxxxx]
On
Behalf Of Joe Lee
Sent: Thursday, October 21, 2004 5:30 PM
To: web400@xxxxxxxxxxxx
Subject: RE: [WEB400] Browser tries to download program

Well, I suppose I could be considered experienced. I think I wrote my
first web page in 1993. Though I suppose it might be sort of weird that
I have never put together my own personal website.

I wouldn't say that there is anything "wrong" with using the
noname/*top sections. The reason that I wouldn't use them is that I like
the consistency of having every section named. Granted in this case
there would only be one unnamed section, but I still prefer to avoid
using a mix of implied and defined section names. I'm also not sure that
it would work with my version of CGIDEV. We kept running into problems
with not enough sections or variables being available, so I rewrote it
using dynamically allocated arrays to store  up to 32K sections and
variables, and I don't think I made provisions for the "noname" section.
I also added several capabilities that weren't available at the time,
this was several years ago, such as loading from the IFS, being able to
load several templates at once, and "conditional" sections which are
like a select statement and allow you to output portions of your section
based on the values of your variables. 

Joe Lee

>>> cozzi@xxxxxxxxx 10/21/2004 15:06:23 >>>
Notepad? Oh, you're an "experienced" HTML coder than. :)
But seriously, Dreamweaver and Frontpage don't complain, but rather
reposition or loose that top section. There's nothing wrong with using
the
'noname' or '*TOP' section identifiers. 
-Bob

-----Original Message-----
From: web400-bounces@xxxxxxxxxxxx [mailto:web400-bounces@xxxxxxxxxxxx]
On
Behalf Of Joe Lee
Sent: Thursday, October 21, 2004 4:57 PM
To: web400@xxxxxxxxxxxx 
Subject: RE: [WEB400] Browser tries to download program

That's interesting, I hadn't realized that, though I think that I
prefer
using named sections rather than an unnamed one. I've never noticed
any
complaints about the section name at the beginning the HTML from my
editor though. Of course that is probably because I only use notepad
or
an enhanced version of notepad for editing HTML. :)

Joe Lee

>>> cozzi@xxxxxxxxx 10/21/2004 14:34:20 >>>
You don't need to have a "top" section name. Most HTML editors don't
like
having something like 
/$TOP
Or 
/$HTML
On the first line of the HTML.
CGIDEV2 and CGILIB support a virtual top section using 'noname' as the
section name. This virtual section continues until the first real
section is
detected.
So in CGIDEV2 you would code (in your CGI RPG program):
Callp  wrtSection('noname')

With CGILIB, you could code:
Callp cgiWrtSection('noname') 
or
Callp cgiWrtSection('*TOP')

-Bob Cozzi


-----Original Message-----
From: web400-bounces@xxxxxxxxxxxx [mailto:web400-bounces@xxxxxxxxxxxx]

On
Behalf Of Joe Lee
Sent: Thursday, October 21, 2004 4:20 PM
To: web400@xxxxxxxxxxxx 
Subject: RE: [WEB400] Browser tries to download program

At the beginning of the first template section that you write to the
browser you need to have at least the following. The string
"Content-type: text/html" followed by 2 carriage return linefeeds
(CRLF)s. You may add other header information but it must be followed
by
the 2 CRLFs which tell the http server that this is the end of the
header section. I use a "html" section that only contains the header
information, and is the same for all of my templates. 
 
A sample would be:
 
/$html
Content-type: text/html

/$NextSection
 
Joe Lee



>>> mskvarenina@xxxxxxx 10/21/2004 14:03:17 >>>
Hmmm. Looks like you're saying I need something like this --> <meta
http-equiv="content-type" content="text/html; charset=UTF-8">

Which I just confirmed is not coming out of my existing CGI apps using
original server.

Is this what you're talking about?


-----Original Message-----
From: web400-bounces@xxxxxxxxxxxx [mailto:web400-bounces@xxxxxxxxxxxx]


On
Behalf Of Bartell, Aaron L. (TC)
Sent: Thursday, October 21, 2004 4:25 PM
To: Web Enabling the AS400 / iSeries
Subject: RE: [WEB400] Browser tries to download program

I am embarrassed to give the answer because I should have looked at
this
first, but make sure your headers are being sent. CGIDEV2 does not
output your headers for you, you must included them in one of your
templates. 

I am guessing that the IBM Original HTTP server was being nice and
must
have sent a default header if a program just starts pushing stuff out
without headers. Apache doesn't do that.

HTH,
Aaron Bartell 

-----Original Message-----
From: web400-bounces@xxxxxxxxxxxx [mailto:web400-bounces@xxxxxxxxxxxx]



Sent: Thursday, October 21, 2004 3:01 PM
To: 'Web Enabling the AS400 / iSeries'
Subject: RE: [WEB400] Browser tries to download program

Great thread. Has anyone discovered the solution yet?

I too attempted to migrate my original servers to Apache today and I
too
received the file download box when I tried to run a RPG CGI program. 

My apologies for posting the entire config file below but I'm sure
there's something in there causing the error and I'm hoping someone
can
recognize it...

LoadModule ibm_ssl_module /QSYS.LIB/QHTTPSVR.LIB/QZSRVSSL.SRVPGM
LiveLocalCache Off
<Location />
<LimitExcept GET HEAD OPTIONS POST TRACE>
Order Allow,Deny
Deny From all
</LimitExcept>
</Location>
Options -ExecCGI -SymLinksIfOwnerMatch -Includes -IncludesNoExec
-Indexes -MultiViews DefaultType www/unknown Listen 10.100.15.184:81
ErrorLogFormatDDS On ErrorLog Off ThreadsPerChild 40
MaxKeepAliveRequests 1 TimeOut 120 KeepAliveTimeout 4 AccessFileName
.htaccess DirectoryIndex welcome.html index.html CGIConvMode
%%MIXED/MIXED%% IndexOptions -DescriptionWidth -FancyIndexing
-FoldersFirst -IconHeight -IconsAreLinks -IconWidth -IgnoreCase
-IgnoreClient -NameWidth -NameMinWidth -ScanHTMLTitles
-SelectiveDirAccess -ShowSmallFileBytes -ShowOwner
-SuppressColumnSorting -SuppressDescription -SuppressHTMLPreamble
-SuppressIcon -SuppressLastModified -SuppressRules -SuppressSize
-TrackModified -VersionSort HeaderName README <Directory />
Order Allow,Deny
Deny From all
</Directory>
<Directory /Docimaging/>
Allow From all
</Directory>
<Directory /WebPages/>
Allow From all
</Directory>
<Directory /QIBM/ProdData/hostondemand/HOD/>
Allow From all
</Directory>
<Directory /cgidev/>
Allow From all
</Directory>
<Directory /QSYS.LIB/CGIDEV2.LIB/>
Allow From all
CGIConvMode %%EBCDIC/MIXED%%
</Directory>
<Directory /QSYS.LIB/CGIBIN.LIB/>
CGIConvMode %%EBCDIC/MIXED%%
Allow From all
<FilesMatch ^(.*)\.PGM$>
Options +ExecCGI
Allow From all
</FilesMatch>
</Directory>
<Directory /cgibin/>
Allow From all
</Directory>
<Directory /QSYS.LIB/CGIBIN.LIB/HTMLSRC.FILE/>
Allow From all
</Directory>
<VirtualHost 10.100.15.184:443>
SSLEngine Off
SSLAppName QIBM_HTTP_SERVER_CONFIG
SSLClientAuth None
SetEnv HTTPS_PORT 443
</VirtualHost>
MapMatch ^/cgibinh/(.*)\.htm$ /cgibinh/$1.mbr MapMatch ^/cgibinh/(.*)
/QSYS.LIB/CGIBIN.LIB/HTMLSRC.FILE/$1
AliasMatch ^/QSYS\.LIB/CGIBIN\.LIB/HTMLSRC\.FILE/(.*)
/QSYS.LIB/CGIBIN.LIB/HTMLSRC.FILE/$1
AliasMatch ^/cgibin/(.*) /cgibin/$1
ScriptAlias /CGIBIN.LIB/ /QSYS.LIB/CGIBIN.LIB/ ScriptAliasMatch
^/cgibinp/(.*) /QSYS.LIB/CGIBIN.LIB/$1 MapMatch ^/cgidev2/start$
/QSYS.LIB/CGIDEV2.LIB/DEMOHTML.FILE/DEMOFRAME.MBR
MapMatch ^/cgidev2/setup$
/QSYS.LIB/CGIDEV2.LIB/DEMOHTML.FILE/SETUPCSA.MBR
MapMatch ^/cgidev2h/(.*)\.htm$ /cgidev2h/$1.mbr MapMatch
^/cgidev2o/(.*)\.htm$ /cgidev2o/$1.mbr MapMatch
^/cgidev2oit/(.*)\.htm$
/cgidev2oit/$1.mbr MapMatch ^/cgidev2o/(.*)
/QSYS.LIB/CGIDEV2.LIB/DEMOHTML.FILE/$1
MapMatch ^/cgidev2oit/(.*) /QSYS.LIB/CGIDEV2.LIB/DEMOHTMLIT.FILE/$1
MapMatch ^/cgidev2h/(.*) /QSYS.LIB/CGIDEV2.LIB/HTMLSRC.FILE/$1
MapMatch ^/cgidev2r/(.*) /QSYS.LIB/CGIDEV2.LIB/QRPGLESRC.FILE/$1
MapMatch ^/cgidev2l/(.*) /QSYS.LIB/CGIDEV2.LIB/QCLSRC.FILE/$1
MapMatch ^/cgidev2d/(.*) /QSYS.LIB/CGIDEV2.LIB/QDDSSRC.FILE/$1
MapMatch ^/cgidev2f/(.*) /cgidev/$1
AliasMatch ^/QSYS\.LIB/CGIDEV2\.LIB/(.*) /QSYS.LIB/CGIDEV2.LIB/$1
AliasMatch ^/cgidev/(.*) /cgidev/$1 ScriptAliasMatch ^/cgidev2p/(.*)
/QSYS.LIB/CGIDEV2.LIB/$1 MapMatch ^/CGI-BIN/APPS/(.*)
/QSYS.LIB/CGIBIN.LIB/DB2WWW.PGM/$1
MapMatch ^/cgi-bin/apps/(.*) /QSYS.LIB/CGIBIN.LIB/DB2WWW.PGM/$1
ScriptAliasMatch ^/QSYS\.LIB/CGIBIN\.LIB/(.*) /QSYS.LIB/CGIBIN.LIB/$1
ScriptAliasMatch ^/cgi-bin/(.*) /QSYS.LIB/CGIBIN.LIB/$1.PGM AliasMatch
^/hod/(.*) /QIBM/ProdData/hostondemand/HOD/$1
AliasMatch ^/(.*) /WebPages/$1
AliasMatch ^/documents/(.*) /Docimaging/$1 # HostName 10.100.15.184 #
AccessReportDoDnsLookup On # DoReporting Off 0 # DoWebUsageMining Off
0
# ReportProcessOldLogs Append # ReportDataArchive purge #
ReportDataExpire 35 # ReportDataSizeLimit 30

-----Original Message-----
From: web400-bounces@xxxxxxxxxxxx [mailto:web400-bounces@xxxxxxxxxxxx]



On Behalf Of Tom Jedrzejewicz
Sent: Thursday, September 09, 2004 5:16 PM
To: Web Enabling the AS400 / iSeries
Subject: Re: [WEB400] Browser tries to download program

My suggestions . . .

1. Get to the most current CGIDEV2 release level. There has been a
bunch done to CGIDEV2 in the 3 years, and a lot of sites have
converted
to Apache.

2. Download the Easy/400 deliverable EASY400APC - it has the other
CGIDEV2 deliverables running under Apache.

http://www-922.ibm.com/easy400p/downloads.html 

Between those two, you should be running, or in a place where figuring
the problem is easier.

Regards.

On Thu, 9 Sep 2004 11:39:42 -0500, Bartell, Aaron L. (TC)
< albartell@xxxxxxxxxxxxxx > wrote:
> Update.
> 
> >Do you have the xTools (www.rpgxtools.com)?
> I have my own tools that I have been able to prove this out with,
but

> thanks for the link. I will check those out also.
> 
> I have both the CGIDEV2 program and RPG CGI program running from the

> same Apache config both out of the same library (AS400CGI) both 
> using/outputting the same IFS file (/CGIRPG/logtime.html). I created

> an RPG CGI pgm to output the logtime.html file just so I could rule 
> out that it wasn't a CCSID issue with the file.
> 
> When I run both programs from an IBM Original HTTP server they both 
> work fine unchanged.
> 
> I must note that our CGIDEV2 version is '2001-09-21 09:20:36'. I got

> that by doing a DSPDTAARA DTAARA(CGIDEV2/VERSION). In my mind that 
> shouldn't make a difference given that the CGIDEV2 programs operate 
> just fine under IBM Original HTTP server.
> 
> We also changed QCSSID to 37 from 65535 with no effect (this was 
> suggested on the CGIDEV2 site).
> 
> I think I have narrowed it down to it having something to do with 
> CGIDEV2. Any ideas based on the information I have presented?
> 
> The machine is on CUM PTF 4077. Are there other specific PTF's that
I

> need to apply that wouldn't be covered by this CUM?
> 
> Apache config that I am now using (from Brad Stone's site)
> 
> Listen *:2012
> 
> #DocumentRoot /myweb
> #DirectoryIndex index.html
> 
> CGIConvMode %%EBCDIC/EBCDIC%%
> 
> ScriptAliasMatch ^/cgi-bin/(.*) /qsys.lib/as400cgi.lib/$1.pgm
> 
> <Directory />
> Options None
> AllowOverride None
> order deny,allow
> deny from all
> </Directory>
> 
> <Directory /myweb>
> AllowOverride None
> order allow,deny
> allow from all
> <FilesMatch "\.html(\..+)?$">
> Options +Includes
> SetOutputFilter Includes
> </FilesMatch>
> </Directory>
> 
> <Directory /qsys.lib/as400cgi.lib>
> allow from all
> order allow,deny
> Options +ExecCGI +Includes
> SetOutputFilter Includes
> </Directory>
> 
> 
> 
> _______________________________________________
> This is the Web Enabling the AS400 / iSeries (WEB400) mailing list
To

> post a message email: WEB400@xxxxxxxxxxxx To subscribe, unsubscribe,

> or change list options,
> visit: http://lists.midrange.com/mailman/listinfo/web400 
> or email: WEB400-request@xxxxxxxxxxxx 
> Before posting, please take a moment to review the archives at 
> http://archive.midrange.com/web400 .
> 
> 



--
Tom Jedrzejewicz
tomjedrz@xxxxxxxxx 
_______________________________________________
This is the Web Enabling the AS400 / iSeries (WEB400) mailing list To
post a message email: WEB400@xxxxxxxxxxxx To subscribe, unsubscribe,
or
change list options,
visit: http://lists.midrange.com/mailman/listinfo/web400 
or email: WEB400-request@xxxxxxxxxxxx 
Before posting, please take a moment to review the archives at
http://archive.midrange.com/web400 .


_______________________________________________
This is the Web Enabling the AS400 / iSeries (WEB400) mailing list
To post a message email: WEB400@xxxxxxxxxxxx 
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/web400 
or email: WEB400-request@xxxxxxxxxxxx 
Before posting, please take a moment to review the archives
at http://archive.midrange.com/web400 .


_______________________________________________
This is the Web Enabling the AS400 / iSeries (WEB400) mailing list
To post a message email: WEB400@xxxxxxxxxxxx 
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/web400 
or email: WEB400-request@xxxxxxxxxxxx 
Before posting, please take a moment to review the archives
at http://archive.midrange.com/web400 .



_______________________________________________
This is the Web Enabling the AS400 / iSeries (WEB400) mailing list
To post a message email: WEB400@xxxxxxxxxxxx 
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/web400 
or email: WEB400-request@xxxxxxxxxxxx 
Before posting, please take a moment to review the archives
at http://archive.midrange.com/web400 .


_______________________________________________
This is the Web Enabling the AS400 / iSeries (WEB400) mailing list
To post a message email: WEB400@xxxxxxxxxxxx 
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/web400 
or email: WEB400-request@xxxxxxxxxxxx 
Before posting, please take a moment to review the archives
at http://archive.midrange.com/web400.



_______________________________________________
This is the Web Enabling the AS400 / iSeries (WEB400) mailing list
To post a message email: WEB400@xxxxxxxxxxxx 
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/web400 
or email: WEB400-request@xxxxxxxxxxxx 
Before posting, please take a moment to review the archives
at http://archive.midrange.com/web400.

_______________________________________________
This is the Web Enabling the AS400 / iSeries (WEB400) mailing list
To post a message email: WEB400@xxxxxxxxxxxx 
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/web400 
or email: WEB400-request@xxxxxxxxxxxx 
Before posting, please take a moment to review the archives
at http://archive.midrange.com/web400.



_______________________________________________
This is the Web Enabling the AS400 / iSeries (WEB400) mailing list
To post a message email: WEB400@xxxxxxxxxxxx 
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/web400 
or email: WEB400-request@xxxxxxxxxxxx 
Before posting, please take a moment to review the archives
at http://archive.midrange.com/web400.

_______________________________________________
This is the Web Enabling the AS400 / iSeries (WEB400) mailing list
To post a message email: WEB400@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/web400
or email: WEB400-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/web400.



_______________________________________________
This is the Web Enabling the AS400 / iSeries (WEB400) mailing list
To post a message email: WEB400@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/web400
or email: WEB400-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/web400.




_______________________________________________
This is the Web Enabling the AS400 / iSeries (WEB400) mailing list
To post a message email: WEB400@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/web400
or email: WEB400-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/web400.




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.