NetHere Knowledge Base (KB)
Main ::Web Hosting
Minimize Text   Default    Enlarge Text

CGI Scripts

What is CGI?


CGI (Common Gateway Interface) is a tool used for creating dynamic web content.  The CGI environment allows communication to occur between CGI programs, the web server and the client.  For example, a visitor fills out information on a web page, submits it to the web servers that processes the information using a CGI program and simultaneously submits the information to a mail server and serves a response page back to the client.


What is a CGI-BIN?


Your cgi-bin is the environment that NetHere has set up within your root directory.  You need to store your cgi programs within the cgi-bin directory in order for them to be executed by your web pages.




Although languages used for CGI programs include, Perl, Visual Basic, C, and others, by far the most popular is Perl.  Perl (Practical Extraction and Report Language) code is written in a text file, known as a script, and can be saved as either a .pl file or .cgi file.  Perl is non-compiled code, unlike C or C++.


Requirements for Running Your CGI Scripts


  1. For sites hosted on a Unix platform
    1. Upload your scripts in ASCII, not binary, within the cgi-bin.
    2. Make sure you change the permissions for the scripts to execute.  If the script is writing to a file, you would need to set write permissions on the file as well.  If you have any issues with adjusting the permissions, please contact us and we will adjust the permissions for you.
    3. The path to the perl module is #!/usr/bin/perl
    4. The file can be saved as either .cgi or .pl.  If you have a script compiled in a language other than perl, you will need to save it as a .cgi file type.
  2. For sites hosted on a Windows platform
    1. Contact so that we can enable Perl for your web site and create your cgi-bin directory for your scripts.
    2. Save your Perl script as a .pl file.
    3. Upload your script to the cgi-bin.  No need to adjust permissions, they are already set to execute by default.



Search Glossary Saved Article Contact us