delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1998/06/12/02:33:21

From: GamerX_ AT usa DOT net (Dylan Griffiths)
Subject: Re: IIS, CGI, and GCC
12 Jun 1998 02:33:21 -0700 :
Message-ID: <001c01bd95d4$20af32c0$8155a58e.cygnus.gnu-win32@hssktn129.sk.sympatico.ca>
Reply-To: GamerX_ AT usa DOT net
Mime-Version: 1.0
To: "Chieh Cheng" <gypsymoth AT mindless DOT com>,
"Gnu Win32 Mailing list" <gnu-win32 AT cygnus DOT com>

-----Original Message-----
From: Chieh Cheng <gypsymoth AT mindless DOT com>
To: gnu-win32 AT cygnus DOT com <gnu-win32 AT cygnus DOT com>
Date: Thursday 11, June, 1998 20:56
Subject: IIS, CGI, and GCC


>I have a problem with a CGI program compiled with GCC and ran under IIS. My
>problem is the exact same problem as the problem listed in the archive at:
>http://www.cygnus.com/ml/gnu-win32/1997-Oct/0293.html


>  fprintf (stdout, "Content-Type: text/html");
>  fprintf (stdout, EOL);
>  fprintf (stdout, EOL);
>
>  fprintf (stdout,
"<html><head><title>whatever</title></head><body><pre>");
>  fprintf (stdout, EOL);


Now, that looks OK.. Especially since I sat down and wrote a CGI program
that takes input from a page and turns it into an email to be sent through
my server (took me 6 hours, and it works great).  I'm using the program with
Xitami, not IIS (which is way too bloated).  The code for the page is as
follows:

int main(int argc, char *argv[])
{
   size_t content_length;
   int x;
   FILE *fp;

   if(strcmp(getenv("REQUEST_METHOD"), "POST"))
   {
      printf("Content-Type: text/html\n\n");  /* This could be the problem
solver */
      puts("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 3.2 Final//EN\">");
      puts("<head><title>CGI error</title></head><body>");
      puts("This script should be referenced with a METHOD of POST.\n");
      puts("If you don't understand this, see this ");
      puts("<A
HREF=\"http://www.ncsa.uiuc.edu/SDG/Software/Mosaic/Docs/fill-out-forms/over
view.html\">forms overview</A>.\n");
      puts("</body></html>");
      exit(1);
   }

There's more code, but this shows you the important pieces.  If IIS won't
run it even after you have the headers setup correctly, then it must be a
problem with IIS.. Try it with something like Xitami (www.imatix.com).. It's
only a meg or so to download and there is public source code to examine,
too.  The code itself has been ported to almost every OS.




-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


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