Common Gateway Interface is a way to call a program and
return data to the Web-Server. It has really nothing to do
with what language your CGI program is written in.
If you want to write CGI programs in c++ or VB you'll need
to compile them so they can be executed in your operating
environment and they must conform to the CGI standards to
be able to read input and return data to the Web-server.
/brother t0mas
| [reply] |
I think that the other languages wouldn't be that different to program CGI with. The variables would be passed through the equilivent of ARGV and you just parse it and go.
If you look at some webpages you'll see *.dll's handling CGI. But, can you imagine making a change to a Visual Basic program, recompiling it, uploading it, and then trying it just to find that you missed a period and you have to do it all over again?
The only gripe some people put up is that Executables use less CPU time and memory because Perl has to call the interpreter everytime, this problem is fixed with mod_perl in Apache.
--=Lolindrath=-- | [reply] |
When CGI's are referenced that are written in perl, the perl interpreter
is run. Under *nix the #!/usr/bin/perl line runs the interpreter
and the script that follows in then interpreted. So if you have an
executable C++ or VB program then this can be run using:-
#!/path/to/executable/program
It does not need an interpreter like perl because the program itself is
executable
Hope this helps | [reply] [d/l] |
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.
| [reply] |
Thank you all for your posts... Clears up alot....
I was surprised nobody called me a blasphemer :)
Although Perl is an awesome language, other languages are nice too..... However I think i'll still be doing all my cgi's in perl, that's for sure.... | [reply] |