delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/11/06/10:27:02.3

From: Erwann ABALEA <abalea_e AT fermi DOT cnam DOT fr>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Build CGI programs with DJGPP
Date: Fri, 6 Nov 1998 13:30:38 +0100
Organization: Conservatoire National des Arts et Metiers
Lines: 55
Message-ID: <Pine.OSF.4.05.9811061318520.3270-100000@fermi.cnam.fr>
References: <C12566B2 DOT 004EFA91 DOT 00 AT mail DOT datasys DOT it>
NNTP-Posting-Host: fermi.cnam.fr
Mime-Version: 1.0
In-Reply-To: <C12566B2.004EFA91.00@mail.datasys.it>
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

On Wed, 4 Nov 1998 Fabiano_Zara AT www DOT datasys DOT it wrote:

> It's possible to wite CGI programs with djgpp?. I founded  problems in
> execute it like this:
> 

Very easy... But your HTTPD must support DOS based CGI... Not all of them
support DOS programs.

> I use OMNI HTTPD server, WIN95 as OS.

I use Apache 1.3.1, and it works perfectly.

> Can you give me a hint, or can you show an exemple?
> Thank you

You can start writing a printenv-equiv program.

Just dump the env. vars (either using getenv() or the (int argc, char
**argv, char **env) parameters of the main() function.

Don't forget to send the result in the good format: header, blank line,
and them message...

Example:
Content-Type: text/html; charset=iso-8859-1
Accept-Ranges: bytes

<html>
<head>
<title>Zen...</html>
</head>
<body>
whatever you want...
</body>
</html>

Under Apache, the query_string is placed in the environment var
QUERY_STRING.

If you need to handle POST requests, the environment var CONTENT_LENGTH
should contain the total bytes the browser has sent, and you should read
that number of bytes from stdin. The parsing of the data read depends of
the encoding method (x-www-urlencoded or ... (I don't remember, something
like multipart MIME)).

Erwann.

--
Erwann ABALEA       Certplus SA
System and Development Engineer
eabalea AT certplus DOT com     (work)
abalea_e AT cnam DOT fr       (school)

- Raw text -


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