View Full Version : Perl & CGI ??
ChuckSchuldiner
02-17-2005, 01:01 PM
what is the CGI (common gateway interface)? ... i know that perl is a prog language and it is a CGI compliant language ... if i am correct? ... what do you mean by this CGI compliant ? ..just trying to quench my curiosity
mlseim
02-17-2005, 02:03 PM
CGI (Common Gateway Interface) is not a language.
It's a protocol or method, an interface handling the packet of
information sent from a browser to a server.
Any language platform, C++, Perl, PHP, ASP can utilize the
CGI installed within a server.
An example of using this with Perl:
Suppose you have an HTML webpage with a form,
and one of the text boxes has the variable named "user_email".
When the form is submitted to the Perl script, it will use CGI to
"take-in" the variable you have named in your form:
#! /usr/bin/perl
use CGI ':standard';
my $email=param('user_email');
The variable $email is now the email address entered from the form.
All other scripting languages would use a similar type of method.
.
ChuckSchuldiner
02-17-2005, 03:50 PM
for example when we use php like..
$var=$_POST['user_email'];
or ASP as..
var theEmail=Request.Form("user_email");
am i making use of the common gateway interface...??
mlseim
02-17-2005, 04:18 PM
Yes ....
Here's a definition I found on Google:
=======================================================
(Common Gateway Interface) -- A set of rules that describe how a Web Server communicates with another piece of software on the same machine, and how the other piece of software (the 'CGI program') talks to the web server. Any piece of software can be a CGI program if it handles input and output according to the CGI standard. Usually a CGI program is a small program that takes data from a web server and does something with it, like putting the content of a form into an e-mail message, or turning the data into a database query. CGI "scripts" are just scripts which use CGI. CGI is often confused with Perl, which is a programming language, while CGI is an interface to the server from a particular program. Perl is an application of CGI, as well as MIVA, Python, PHP3, and other scripting languages. See Also: cgi-bin , Web
.
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.