Hi,
: I would like to know what exactly this CGI is.
: I only know what this 3 letters stand for but I can't imagine
: anything under that.
CGI is a standard way for a web server to interface with an external program that takes input that the server has recieved and generates a page dynamically based upon it. Thus the common bit is becuase it's a standard, gateway because it's the way data is passed between two systems, and interface because it's what's between two systems. Or something like that...
Basically, the web server sets several environment variables detailing the request, and then any data that was sent using the POST method is sent to STDIN. The CGI program is then responsible for reading and parsing that data coming from the web server. It prints any output to go to the browser to STDOUT, and then the web server passed that data on to the end user who made the request. So it's basically User request --> Web Server --> CGI Program --> Web Server --> Response to user.
: I mean why do you talk of PERL as a CGI language but you don't do so
: with PHP. What are other CGI languages.
PHP is generally not talked of as a CGI language because the vast majority of the time it runs as a module in the web server. You can use PHP in CGI mode if you want, but generally people don't. OTOH, Perl when used for web stuff traditionally uses the CGI route. I believe the web server module route wasn't open to it when people started using Perl for doing web stuff. However, these days, we have mod_perl which enables Perl to run as a web server module rather than CGI. It's just that not everyone uses it.
Note developing CGI is only one application of Perl, and it wasn't designed just for doing CGI; any programming language that can take data on STDIN and through environment variables and shove data to STDOUT can be used. So that's C, Python, even VB, etc...most programming languages are suitable. Usually compiled languages such as C are not used as you have to re-compile the CGI everytime it needs changing. Then, C ones will be faster.
: Why do people think this system is about to die out?
I don't think it's about to die out real soon, but it has got one significant issue - resource usage. Everytime you run a Perl CGI a new proccess has to be forked, the Perl program needs to start, the script needs to be compiled...etc, etc. This has a fairly significant resource overhead. But hey, at least when it runs as a seperate proccess it can't trash your web server proccess, which I've heard several badly (and hopefully unfortunately) written PHP scripts being able to do.
:
Hope someone will find this post in this forum although it is
: kind of empty... :-/
Yeah, this is a fairly quiet forum so it's nice to have the odd post every so often. (As the mod, I check it regularly though!)
Time to go prepare for hard exam this afternoon...
Hope this helps,
Jonathan
###
for(74,117,115,116){$::a.=chr};(($_.='qwertyui')&&
(tr/yuiqwert/her anot/))for($::b);for($::c){$_.=$^X;
/(p.{2}l)/;$_=$1}$::b=~/(..)$/;print("$::a$::b $::c hack$1.");