Is this possible to write CGI code by C or C++ ? please give me a "hello World !!!" Example .
Absolutely.
#include <stdio.h>
int main(int argc, char *argv[]])
{
printf("Content-type: text/plain\n\n");
printf("Hello, world!\n")
}
Eva, once you understand the basics of Ignacio's answer (cgi-bin, executing from browser, web server, etc) there are some very helpful libraries to assist with web type execution.
Here is the library I used for my cgi in C, works great, saves you days:
(cgihtml is a set of CGI and HTML routines written for C)
http://eekim.com/software/cgihtml/index.html
you can add html templates for displaying large amounts of data:
http://www.algonet.se/~thunberg/template2doc/
Light weight WebServers:
http://en.wikipedia.org/wiki/Comparison_of_lightweight_web_servers
and more resources:
http://cgi.resourceindex.com/Programs_and_Scripts/C_and_C++/Libraries_and_Classes/
http://en.wikipedia.org/wiki/Common_Gateway_Interface
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With