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 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit To: "Chieh Cheng" , "Gnu Win32 Mailing list" -----Original Message----- From: Chieh Cheng To: 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, "whatever
");
>  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("");
      puts("CGI error");
      puts("This script should be referenced with a METHOD of POST.\n");
      puts("If you don't understand this, see this ");
      puts("forms overview.\n");
      puts("");
      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".