www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/10/11/21:50:10

From: "Johan Venter" <jventer AT writeme DOT com>
Newsgroups: comp.os.msdos.djgpp
References: <38010A1D DOT BCF60B35 AT null DOT videotron DOT ca>
Subject: Re: Question regarding CGI
Lines: 51
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2314.1300
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
Message-ID: <GdkM3.2450$_4.4142@newsfeeds.bigpond.com>
Date: Mon, 11 Oct 1999 11:00:21 +1000
NNTP-Posting-Host: 203.40.83.91
X-Trace: newsfeeds.bigpond.com 939642854 203.40.83.91 (Mon, 11 Oct 1999 21:54:14 EST)
NNTP-Posting-Date: Mon, 11 Oct 1999 21:54:14 EST
Organization: Telstra BigPond Internet Services (http://www.bigpond.com)
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

bub <bub AT null DOT videotron DOT ca> wrote in message
news:38010A1D DOT BCF60B35 AT null DOT videotron DOT ca...
> Hi all,
>
> Been using djgpp for a little while now on windows nt.
> Today I decided to try to write a CGI application to use via
> Windows NT's Peer web service's web server. The code ( fairly
> simplistic, included below ). I get an error when I try to run
> it, claiming that the application didn't return the proper http
> headers, it then includes nothing as the error.
> I compiled the same code under Visual C++ on my work PC, and
> it runs fine... what gives ?

Can Windows NT's web server run DOS executables? The code below should work
fine. I write all my CGI's in DJGPP and they run perfectly on various servers.

> I couldn't find any references to CGI or problems related to it
> in the DJGPP FAQ.

It's not really something that's part of DJGPP. The CGI interface is so simple,
there is not much place for error if your program is printing to stdout, unless
of course you're server doesn't like the executable.

> /*----------- foo.c --------------------
>    cgi app that prints blah blah in red
> */
>
> #include <stdio.h>
>
> int
> main(int argc, char **argv)
> {
>   fprintf(stdout,"Content-Type: text/html\n\n");
>   fprintf(stdout,"<html> <body bgcolor='000000' text='ff0000'>\n"
>                  "<h1> Blah blah blah </h1>\n"
>                  "</body> </html>");
>
> return 0;
> }

Very strange indeed. It should work. Have you tried just plain printf (not that
that makes make difference)?. Maybe this is just a case of an egotistical
Microsoft product not wanting to run a DOS executable.

--
Johan Venter
ICQ 3643877 - jventer AT writeme DOT com
The TPU DJGPP Interest Group - http://surf.to/djgppig
The RSXNTDJ 1.5 HOWTO - http://surf.to/rsxntdj


- Raw text -


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