delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/12/17/18:45:07

From: sam AT greenaum DOT demonARSE!ARSE!ARSE!.co.uk (Sam.)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: CGI / Common Gateway Interface
Date: Thu, 17 Dec 1998 23:39:47 GMT
Organization: Rossum's Universal Robots
Message-ID: <368994ac.1257740@158.152.254.70>
References: <3675FAB4 DOT 918BEB88 AT codenet DOT net>
NNTP-Posting-Host: greenaum.demon.co.uk
X-NNTP-Posting-Host: greenaum.demon.co.uk:194.222.71.189
X-Trace: news.demon.co.uk 913938017 nnrp-06:1051 NO-IDENT greenaum.demon.co.uk:194.222.71.189
X-Complaints-To: abuse AT demon DOT net
X-Newsreader: Forte Agent 1.5/32.452
X-No-Archive: yes
MIME-Version: 1.0
Lines: 30
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

This is all down to your web server. For starters, the URL will
probably be http://whatever/blah/blah/xxxx.exe

CGI works by the server setting environment variables, HTTP_QUERY,
HTTP_COOKIE, and possibly a couple more, then calling your program.
Your program must read these, then print the results to standard
output (ie, printf). The web server will take the standard output and
feed it to the viewer's browser, more or less unaltered. This means
you can include HTTP headers in your output, as well as HTML.

So all you need be able to do is read environment variables, and
output to stdout, beginner stuff. 

The details depend on your web server, which obviously must be running
DOS or Windows or whatever so it can run DJGPP binaries. One I
downloaded ran in Windows and would call your DOS programs from a BAT
file. This is probably not the most efficient way of doing things, but
for the purposes of trying it out, look for a free personal web server
on TUCOWS and read the docs that come with it. They'll tell you how
it's CGI works. Then start the server, and connect to your own
computer (127.0.0.1) with Netscape. You can even connect via proxies
halfway across the Internet, and get friends to try it out for you.
It's pretty easy, actually, give yourself a few hours. 


------------------------------------------------------------------------

The person who said he was a crap presenter knows nothing because compared
to the outwardly camp stuart miles, speech impediment Katy Hill and nothing
upstairs Konnie Huq, he was a true professional. Heh heh heh.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019