// gcc MyTestArgGet.c -o MyTestArgGet #include <stdio.h> void main() { int c; printf("Content-type: text/html\n\n"); printf("<HTML>\n"); printf("<HEAD>\n"); printf("<TITLE>\n"); printf("This is a test page for testing what your CGI gets with GET\n"); printf("</TITLE>\n"); printf("</HEAD>\n"); printf("<BODY>\n"); printf("<H1>\n"); printf("This is a test page for testing what your CGI gets with GET\n"); printf("</H1>\n"); printf("<P>底下是 C CGI 程式在標準輸入 stdin 所看到的所有資料\n"); printf("<HR>\n"); while ((c=getchar()) != EOF) putchar(c); printf("<HR>\n"); printf("</P>\n"); printf("<P>底下是 C CGI 程式在環境變數 QUERY_STRING 看到的所有資料\n"); printf("<HR>\n"); printf("%s\n",getenv("QUERY_STRING")); printf("<HR>\n"); printf("</P>\n"); printf("</BODY>\n"); printf("</HTML>\n"); }