CGI scripts can be in any language, C, C++, Perl, csh, bash, sh, as long as the program itself satisfy the requirements of CGI, as defined in the specs. The restrictions are mostly on the methods in which the cgi script use to get input and dump output. As long as these restrictions are met, the script is fine.
There are two major ways of getting data in a cgi script, one through environment variable lookup, or GET method, one through parsing URL, or the POST method.
CGI scripts allow the use of forms as well. Check out the registration form for this seminar! On line!
For an example, check out the CGI script here and see what it does.
CGI scripts do present some security risks. Be careful when you write them!
A HTTP server or HTTPD (daemon) server HTML files, gif files and whatever files you want other to access via the WWW. There is an API from LCS/W3C in C. It uses the TCP/IP protocol as the implementation backbone. The API is easy to use and fairly easy to understand.
Check out the NCSA httpd docs. Read some of the example configuration files from there.
Writing daemon is not hard. There is a very systematic way of doing it. You could also choose between different protocols, IPX and RPC are just a few examples.
The read more about writing daemons, read the on line how-to doc, and more importantly, R. Stevens' networking book. Comer also has a few very good books on networking client-server environment.
coked - Never thought your coke machine would be on the internet, right? Well. It is here...
Daemons also present a security hole. Be very careful...
Other ways of interfacing also include using tk/tcl, specially designed server scripts (much like cgi), etc.