Related Topics
Common Gateway Interface (CGI)
While HTML allows you to create only static content, CGI applications allow you to create active content. For example, you can create interactive forms, such as web counters, or continuously update fields, such as date fields. You can write a CGI script in any language that will create an executable object on your system. For example, C++, Visual Basic, or Perlscript on Windows and C or C++ compilers on Mac OS X (or any compiled or scripting language that supports read/write standard input and standard output).
Basic CGI syntax
To use the CGI, simply call it from your HTML document using this syntax:
• /cgi-bin/executable-name?arguments
or
• /cgi-bin/foldername/executable-name?arguments.
where,
• cgi-bin is the folder name
• foldername a subfolder name
• executable-name the name of your cgi executable
• arguments any additional arguments attached to the cgi executable
You can place a link on a web page to the executable file.
Adding a CGI script
The following is an example of the CGI script we placed on our Husky Planes home page to generate random links for our web site visitors.
To add a CGI script on Husky Planes we followed these steps:
1 Create a cgi-bin folder in the same folder as the FirstClass server and Internet Services executable files.
2 in the cgi-bin folder
Create a folder to hold your CGI script files.
We created a folder called rand_link.
3 Install all the CGI files in the folder you created in Step 2.
4 Follow the information contained in the CGI ReadMe to configure your executable.
5 Add a link to your company home page (or any other HTML document on your web site) using the line of code provided in the CGI ReadMe document.
6 Log into your web site and test your CGI executable.
In Using the Aliases document we will show you how to hide the CGI script we just created from the browser.
|