Simple CGI Programming in C | |||
| |||
#include <stdio.h> #include <stdlib.h> int main(void) { char *data; printf("Content-Type:text/html;xdxa"); // HTML out start !! printf("<TITLE>Multiplication results</TITLE> "); printf("<H3>Multiplication results</H3> "); data = getenv("QUERY_STRING"); // getting parameters if(data == NULL) printf("<P>No Query string found"); else printf("<P>%s", data); return 0; } If you want to run this application on Apache platform, you can test this application by copying to Apache cgi-bin directory. If it's compiled as test.exe and installed in Apache installed local PC, you can test it by following URL: http://127.0.0.1/cgi-bin/test.exe http://127.0.0.1/cgi-bin/test.exe?helloworld Tags: C++ CGI CGI Example CGI Sample MFC CGI Example QUERY_STRING getenv | |||
| |||
| |||
Login for comment |