Search results for 'CGI Example'. 1 post(s) found.
- 2007/08/27 Simple CGI Programming in C
Here's the simplest C based CGI Example.
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
char *data;
printf("Content-Type:text/html;\xd\xa"); // HTML out start !!
printf("<TITLE>Multiplication results</TITLE>\n");
printf("<H3>Multiplication results</H3>\n");
data = getenv("QUERY_STRING"); // getting parameters
if(data == NULL)
printf("<P>No Query string found");
else
printf("<P>%s", data);
return 0;
}
#include <stdlib.h>
int main(void)
{
char *data;
printf("Content-Type:text/html;\xd\xa"); // HTML out start !!
printf("<TITLE>Multiplication results</TITLE>\n");
printf("<H3>Multiplication results</H3>\n");
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
Another posts included in "C, C++"
| Fast and Good Keyboard/Mouse Test without the message handler (0) | 2007/08/27 |
| Using the shell to receive notification of removable media being insert... (0) | 2007/08/28 |
| UDP Send and Receive Using CAsyncSocket (0) | 2007/08/28 |
| C++ CGI Example working on Apache (0) | 2007/08/27 |
Trackback : Cannot send a trackbact to this post.
-
Subject different money making ideas
2010/01/29 00:20
moneyideas
-
Subject different money making ideas
2010/01/29 08:47
moneyideas
-
Subject different money making ideas
2010/01/31 16:44
moneyideas

Prev

Rss Feed