Implementing custom CGI scripts

Our UNIX web servers have the capability to run CGI scripts in your very own "cgi-local" directory. Scripts may be written in Perl, Unix SH, KSH, CSH. Perl is our language of choice as it is a world standard and is well suited to CGI.

Windows hosting customers have a "cgi-bin" directory for PERL scripts.

Here are some helpful tips to follow when installing scripts;

UNIX Shell Scripts

  1. Upload to your cgi-local directory to ensure proper file permission settings
  2. Upload in ASCII transfer mode (and NOT BINARY mode)
  3. The first line of each script must read: #!/bin/sh , #!/bin/csh or #!/bin/ksh based on whichever shell scripts you prefer using.
  4. Reference the script using /cgi-local (and NOT /cgi-bin)
  5. Always remember to include echo "Content-type: text/html\n\n"

Perl Scripts

  1. Upload to your cgi-local directory to ensure proper file permission settings
  2. Upload in ASCII transfer mode (and NOT BINARY mode)
  3. The first line of each script must read: #!/usr/local/bin/perl
  4. Use the Perl script checker in your Control Panel to check syntax.
  5. Reference the script using /cgi-local (and NOT /cgi-bin)
  6. Always remember to include print "Content-type: text/html\n\n"; or alternatively using the Perl module CGI.pm (If you do not, your scripts will not run and you will get an Internal Server Error message).  
    use CGI qw(:cgi-lib :standard);
    print header();

The UNIX system path to the sendmail program on your server is
/usr/lib/sendmail

The UNIX system path to the date command is
/sbin/date