Do you have a question? Post it now! No Registration Necessary. Now with pictures!
August 16, 2007, 4:54 pm
rate this thread
Re: about CGI
You will have a cgi directory on your server (you may to configure that
yourself), this is where you place cgi scripts and binaries.
The cgi has to generate the data that is sent to the user, this includes even
the mime type header (if you forget this, your cgi will not work).
If I remember it right (it's like 7 years ago), the incoming data is read from
the $arg array in main(). Data you store within the program is all up to you.
Here is a good place for you start looking for more information:
Re: about CGI
That's OK - CGI is just an interface between the web server and a child
process. It concerns specific environment variables, and what kind of data
the child process must understand and produce on its standard input and
Perl is popular for this purpose because of its robust string handling,
which makes it a good fit for working with the text-based data formats that
are very common on the web. But the CGI spec itself is language-agnostic.
Any language, whether compiled or interpreted, can be used to write a CGI.
It doesn't even need to be an HTML page. A CGI can produce any type of output
using any means the author wants, whether that is reading HTML from a file
and print it, or generating a graph and returning it as GIF image data.
You can find links to information regarding the CGI "standard" - a de facto
standard, which hasn't been formalized as an RFC - at the W3C site:
One popular library of CGI functions is LibCGI. It's plain C functions, not
C++ classes, but they're callable from C++:
Web Hosting by West Virginians, for West Virginians: http://wv-www.net
Cocoa programming in Perl: http://camelbones.sourceforge.net