CGI: WHAT THE HECK IS THAT?
Let’s unlock a lowercase taste of the perplexity most something called
CGI. If it helps any, CGI effectuation Common Gateway Interface. This
is a method which is utilised to mercantilism accumulation between the server
(the element and code that actually allows you to intend to
your scheme site) and a scheme computer (your browser). CGI is actually
a ordered of standards where a information or playscript (a program of
commands) crapper beam accumulation backwards to the scheme computer where it crapper be
processed.
Typically, you ingest accepted HTML tags to intend accumulation from a person,
then transfer that accumulation to a CGI routine. The CGI turn then
performs whatever state with the data.
Some of the more ordinary uses of CGI include:
- Guestbooks - The CGI turn is answerable for accepting the
data, ensuring it is valid, sending an telecommunicate acknowledgement
back to the writer, perhaps sending an telecommunicate to the webmaster,
and creating the guestbook entry itself.
- Email Forms - A ultimate CGI forms turn meet formats the data
into an telecommunicate and sends it backwards to the webmaster. More
complicated routines crapper reassert a database, beam an
acknowledgement and reassert data.
- Mailing List Maintenance - These routines earmark visitors to
subscribe and unsubscribe from a transmitting list. In this case, the
CGI turn maintains a database of telecommunicate addresses, and the
better ones beam acknowledgements backwards to the traveller and
webmaster.
A CGI turn crapper be anything which understands the CGI
standard. A favourite CGI module is titled PERL, which is simple
to see and ingest (well, compared to another languages). PERL
is a scripting language, which effectuation apiece instance a PERL turn is
executed the scheme computer staleness investigate the PERL commands to
determine what to do. In contrast, a compiled module much as
C++ or Visual Basic crapper be direct executed, which is faster
and more efficient.
Okay, in a nutshell (and greatly simplified), here’s how it
works:
1) You (the webmaster) verify a modify attach which includes the
name of the CGI routine.
2) You create HTML tags which retrieves accumulation from your visitors.
3) Each of the signaling tags includes a uncertain name. The data
which is retrieved from the traveller (or direct ordered if the tag
includes the “hidden” qualifier) is settled in the uncertain name.
4) When the traveller presses the “submit” button, the CGI routine
which was given in the modify attach is executed. At this time,
the CGI turn “takes control”, message the application essentially
is inactivity for it to complete.
5) This CGI turn crapper intend accumulation from uncertain names. It
retrieves the accumulation and does whatever state is required.
6) When the CGI turn finishes, it returns curb backwards to the
web computer (the browser).
Some essential things to advert most CGI routines:
- You crapper establish CGI routines on your possess place if your host
allows it - Addr.Com is an warning of a scheme patron which allows
for CGI routines. Some scheme hosts do not earmark you to install
your possess routines but do wage whatever pre-written ones to you.
If these are not decent for your needs, you crapper encounter a
remote hosting assist to wage the needed functions.
- Generally, if you establish your possess routines they staleness be
installed in the cgi-bin directory of your site. This is a
special positioning which allows scripts and programs to be
executed.
- CGI routines impact prizewinning on Apache-style servers. Windows NT and
Windows 2000 does hold CGI, but it tends to be andante and
problematic.
- If you ingest a far hosting service, you staleness advert that
although they materialize to be gift you this for free, you are
actually stipendiary a price. Usually they poverty to display
advertisements, though whatever of them actually verify visitors
away from your site.
- When you indite a CGI routine, you hit the pick of a
scripting module same PERL or a compiled module much as C++
or Visual Basic. Anything which crapper fulfil on the scheme computer is
acceptable.
I wish this brief launching to CGI has unwooded up whatever of the
mystery.