CGI 58; What the Heck Is That 63;
Let's unlock a petty bit of the puzzle approximately something called CGI. Whether it
helps any, CGI money Universal Gateway Interface. This is a line which is
used to moderate counsel between the server (the hardware and software that
actually allows you to amuse to your lacework site) and a netting client (your
browser). CGI is in fact a fix of standards where a programme or script (a
series of commands) can mail info back to the net server where it can be
processed.
Typically, you convenience sample HTML tags to gratify information from a person, then pass
that news to a CGI routine. The CGI routine then performs some alacrity with
the data.
Some of the extra habitual uses of CGI include:
- Guestbooks - The CGI routine is bound for accepting the data,
ensuring it is valid, sending an email acknowledgment back to the writer,
perhaps sending an email to the webmaster, and creating the guestbook entry
itself.
- Email Forms - A incomplex CGI forms routine aloof formats the facts into an
email and sends it back to the webmaster. Another complicated routines can
maintain a database, dispatch an acknowledgement and validate data.
- Mailing Record Concervation - These routines own visitors to subscribe and
unsubscribe from a mailing list. In this case, the CGI routine maintains a
database of email addresses, and the fitter ones letter acknowledgements back
to the guest and webmaster.
A CGI routine can be anything which understands the CGI standard. A popular
CGI vocabulary is called PERL, which is intelligible to cognize and exercise (well,
compared to other languages). PERL is a scripting language, which resources each
time a PERL routine is executed the mesh server must scrutinize the PERL
commands to figure what to do. In contrast, a compiled utterance such as
C++ or Visual Basic can be directly executed, which is faster and more
efficient.
Okay, in a nutshell (and enormously simplified), here's how it works:
1) You (the webmaster) specify a embodiment tag which includes the flag of the CGI
routine.
2) You constitute HTML tags which retrieves material from your visitors.
3) Everyone of the input tags includes a variable name. The data which is
retrieved from the visitor (or directly place provided the tag includes the "hidden"
qualifier) is placed in the variable name.
4) When the visitor presses the "submit" button, the CGI routine which was
specified in the configuration tag is executed. At this time, the CGI routine "takes
control", acceptation the browser essentially is waiting for it to complete.
5) This CGI routine can purchase data from variable names. It retrieves the data
and does whatever transaction is required.
6) When the CGI routine finishes, it returns authority back to the lattice client
(the browser).
Some exceptional matters to conjure up about CGI routines:
- You can install CGI routines on your own objective if your host allows it -
Addr.Com is an copy of a interlacing host which allows for CGI routines. Some web
hosts bring about not confess you to install your own routines on the contrary act administer some
pre-written ones to you. If these are not sufficient for your needs, you can
find a remote hosting overhaul to dispense the requisite functions.
- Generally, if you install your own routines they must be installed in the
cgi-bin directory of your site. This is a certain mark which allows
scripts and programs to be executed.
- CGI routines assignment capital on Apache-style servers. Windows NT and Windows
2000 does abutment CGI, however it tends to be slow and problematic.
- If you call a remote hosting service, you must call up that although they
appear to be giving you this for free, you are indeed paying a price.
Usually they thirst for to an act advertisements, although some of them actually
take visitors elsewhere from your site.
- When you compose a CGI routine, you accept the election of a scripting language
like PERL or a compiled talking such as C++ or Visual Basic. Anything which
can execute on the web server is acceptable.
I dream this short introduction to CGI has cleared up some of the mystery.
Published: January 15, 2008