'=========================================================================== ' Subject: CGI WITH BASIC Date: 06-29-98 (07:40) ' Author: Jason Beam Code: PB ' Origin: beamer@dockingbay.com Packet: FAQS.ABC '=========================================================================== 'Subject: CGI with basic? YES! 'Hey to the ABC clan... 'this is my first time submitting anything, but i thought this might be of 'some value to anyone... 'either i'm the first, or the idea just hasn't become popular enough, but i 'found a way to do CGI on the WWW with basic...well, a PowerBasic based 'program anyway....i've only tried this with PB's free thing, 'FirstBasic...but it works...and there's alot that can be done... 'I'm also amazed at the speed achieved by this...surprised the heck outa 'me...being an EXE file, it doesn't have to load an interpreter, but this 'stuff is just wonderful...i love it...here's what i came up with when i 'actually discovered the way to do it: '+---------------------- Basic code below ------------------------+ open "CONS:" for output as 1 ' Needed for CGI output! defint a-z print #1, "Today is:
" print #1, date$ print #1, "

Environment variables are:
" for x = 1 to 255 ev$ = environ$(x) if ev$ = "" then goto done print #1, ev$ print #1, "
" next x done: close 1 '+-------------------- End of Basic code --------------------+ 'now, with the Web server i use (Xitami) all i had to do was point to it in 'the browser and it did it's thing...i knew that the server would run the 'file..my trouble was getting output to the page. The server's docs kept 'talking about the CGI_STDOUT environment variable, so i kept pointing to 'that for a bit, but with batch files, all ya gotta do is echo or type a 'file. So i fiddled a bit and found that CONS: will go right up to a 'page...i still haven't found out why 'Content-type: text/html' isn't 'required, but i'm not gonna complain.... 'i'm willing to do it this way over learning _another_ language...jeez...and 'if it means the return of Basic, well so be it! 'Beamer