All languages that have a concept of standard input/output
and environment variables can be used for CGI. The
webserver will set the appropriate environment variables
(CONTENT_LENGTH, QUERY_STRING, etc.), and pass any POST
data on to the program as standard input. And, as with
perl, any data printed to standard output is sent to the
browser.
If you want to check out some source for a CGI written in
C, check
this page. The util.c file at the bottom of the page
is a commonly-used utility to take care of the parsing
of query strings. I believe there are security holes in
it somewhere, so I wouldn't recommend actually using it,
but it's a good thing to look at to understand CGI in
other languages. It's also a good thing to look at to see
why perl's string parsing is so well suited to CGI.
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|