[Xitami] basic as a script cgi code

Paul Reid preid at rci.rutgers.edu
Wed Jun 4 23:50:02 CEST 2008


 > basic as a cgi code

ANY DOS/Win program (likewise anything executable under unix) can be run 
as a CGI.

Most won't do much good/useful stuff; you need to know CLI interface and 
how to mesh with GCI.

...\Xitami\webpages\xitami\INDEX5.HTM

As noted there, even a dumb old .BAT file can CGI (though this is very 
awkward because half the BAT syntax overlaps HTML syntax).

My first CGI was a "hello world" BAT file; my second was a 
QuickBasic-for-DOS "hello world" EXE file. I then coded a whole filter 
with database lookup in QuickBasic4.5 (for DOS!) running as a CGI.

Some minor hammering because QB does not by default work on streams, 
also it had a 64K chunk-limit. I found instructions to hack Visual Basic 
fer Windows (which has larger limits) to omit the GUI and work on 
streams; that was my main CGI for years. The overhead of calling a 224KB 
EXE file (which did dumb linear searches in an unindexed datafile) was 
never a problem even on P-133MHz.

I think my form-submission CGI process is -still- a DOS BAT file calling 
various mail functions and ECHOing back the confirmation... yeah:

@echo off
@ mail -s "Form Return" suzie at school.edu <  ~~~ 
c:\webpages\%FORM_FOLDER%\%FORM_FILENAME%.txt >>mail.logger
@ type c:\webpages\%FORM_FOLDER%\%FORM_FILENAME%.txt >> ~~~
c:\webpages\%FORM_FOLDER%\%FORM_FILENAME%.log

Don't over-think, over-design, or get into strange little solutions.

OTOH, unless you are married to BASIC, Perl and PHP run under Xitami. 
PHP has one function, coded to an Apache quirk/flaw, which bombs under 
Xitami; otherwise it is sweet. Perl and PHP have library functions which 
make hard-work in old BASIC too-easy. (VBscript may do more... but then 
why not go all-the-way and use MS IIS server?)


-- 
Paul Reid



More information about the Xitami mailing list