CGI stands for Common Gateway Interface. Basically, it is the way of having a program on the web server accept information from the user, usually via a HTML form, do something based on that information, and return a page. It's how you get interactive on your website. More technically, CGI is the interface between the web server and the program that runs and handles the request. This program, usually referred to as the CGI script, interfaces with the web server to handle the request. You can write your own or download one of the huge number of freely available CGI scripts. CGI scripts can be written in a verity of languages. The trick is getting the web server to recognize that a certain file is a CGI script to be executed and not a file to be returned. If the web server is not told that a file is a CGI script, it will just return the contents of the script to the user and not execute it. When the web server is given all of the right clues, it will execute the CGI script which will do its function and return a page to the user. What language to use? You can program active web pages in a variety of languages on your web hosting service with DRH Internet. Here is a listing of the most common options: Perl Perl is a full-featured programming language used for much more than just CGI scripting. It is very popular for writing CGI scripts and there are many freely available perl programs (often called perl scripts) out there which you can use and learn from. The Perl programming language has great acuity at manipulating text and data, which makes it great for web applications. This is compared to a language like C which was designed for speed of numerical computation. With Perl you write a program that prints a web page (unlike php where you write a web page with programmatic statements embedded). We have support for the MySQL database in Perl, so database driven web sites can be created. PHP3 PHP3 is a web scripting language where you embed programmatic statements inside of a web page. Each page can also include other files and the programmatic language is fully developed, so complex applications can be built. PHP3 was designed from the ground up for building website applications. Someone looking to get started and build a simple first application, if not already a programmer, might find PHP3 easier to learn than Perl. We have installed the MySQL module for php3 so that database driven web sites can be created. Server side includes (SSI) Server side includes are not technically a programming language, and thus not technically "CGI programs". However, server side includes (SSI) are worth mentioning here. Server side includes are a very limited set of commands that can be imbedded in a web page to: set variables, retrieve data in variables, branch (if statements), include other files, print the date, etc. The primary use of server side includes is the ability to include another file into a file. This is often used to create common headers and footers on a web site: the header and footer are each in their own file, with every file on the site including them with SSI. Then, when the webmaster wants to change the header, only one file has to be edited and every page is updated. Because server side includes are so simple they run extremely fast. Server side includes can not access a MySQL database. Others: C, Python, Tcl, Shell We allow you to write CGI programs in other programming languages available on our web servers. These are not as common as Perl, PHP3, and SSI, but they do work on our servers. Where to go from here We have simple tutorial pages setup for each of these different CGI methods. They will get you started, but to expand your knowledge each of those tutorials links out to further resources on the Internet.
|
||||||