| www.delorie.com/archives/browse.cgi | search |
| From: | "Combatra V" <combator AT hotmail DOT com> |
| Newsgroups: | comp.os.msdos.djgpp |
| Subject: | Learn writing a CGI program, |
| Date: | Sun, 1 Apr 2001 22:21:00 +0700 |
| Organization: | Samart Internet, Thailand |
| Lines: | 41 |
| Message-ID: | <9a7gni$rd8$1@chatta.samart.co.th> |
| NNTP-Posting-Host: | dialup32-173.samart.co.th |
| X-Trace: | chatta.samart.co.th 986138163 28072 203.149.32.173 (1 Apr 2001 15:16:03 GMT) |
| X-Complaints-To: | usenet AT chatta DOT samart DOT co DOT th |
| NNTP-Posting-Date: | Sun, 1 Apr 2001 15:16:03 +0000 (UTC) |
| X-Priority: | 3 |
| X-MSMail-Priority: | Normal |
| X-Newsreader: | Microsoft Outlook Express 5.00.2615.200 |
| X-MimeOLE: | Produced By Microsoft MimeOLE V5.00.2615.200 |
| To: | djgpp AT delorie DOT com |
| DJ-Gateway: | from newsgroup comp.os.msdos.djgpp |
| Reply-To: | djgpp AT delorie DOT com |
Hi,
I compiled and ran the following program with Cygwin tools.
It worked OK.
But when compiled it with djgpp tools - gcc 2.95.3, it didn't work.
It can run on the dos prompt.
But when it is a CGI, it didn't work.
The browser waited for server response forever.
Why?
It seem to me that there is a problem with stdout???
Please help.
Piyatad
------------------------------------
/* hello.c: a CGI example by Thomas Boutell. */
/* Bring in the declarations for standard C input and output */
#include <stdio.h>
/* Declare the main function */
int main(int argc, char *argv[])
{
/* First indicate the content type of the document; in this
case we are outputting HTML. Note that we output
TWO carriage returns after the content type.
This is important! */
printf("Content-type: text/html\n\n");
/* Output a proper HTML document, with <head>
and <body> tags. */
printf("<head>\n");
printf("<title>Hello, World</title>\n");
printf("</head>\n");
printf("<body>\n");
printf("<h1>Hello, World</h1>\n");
printf("</body>\n");
return 0;
}
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |