25 Years Successfully Designing, Hosting and Promoting Websites

 

Home
Up
Web Design Tutorial
About Us
Why Choose Us
FAQ
Search Page
Features
Interesting Links

XML Sitemap

Websites Online is honored to be a


And winner of the

Implementing Custom CGI Scripts

Our servers have the capability to run CGI scripts based on Perl, Unix SH, KSH, CSH, and C (NOT C++) languages. Perl is a our language of choice as it is a world standard and is well suited to CGI. In addition, Perl code does not require manual compilations whereas C code must be compiled* on our web servers prior to use.

If you have a custom CGI script that you need to use, simply upload it to your personal "cgi-local"

Here are some helpful tips to follow when installing scripts;

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();

 

If a script calls another file within your account, but the script does NOT require a URL, you need to use the system path. Instead of using the absolute path to your home directory ("/www26/web/someid"), you should instead use the DOCUMENT_ROOT environment variable ($ENV{DOCUMENT_ROOT} in Perl) to determine the path of your files or programs within a script.

e.g.

From:
/www23/web/yourid/data/fact.html

To:
$ENV{DOCUMENT_ROOT}/data/fact.html

 


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

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


*** We can run only two C compilations for you. As such, we suggest Perl as an alternative scripting language. A work around may be available to seasoned C developers. C++ is NOT supported.

Other Resources
DOS based Perl editor
comp.lang.perl.misc
comp.infosystems.www.authoring.cgi

 

 

Search this site by typing in your search term then click the search button.

Custom Search

 

Hit Counter Since July 17, 2006

Google+

Please contact the Webmaster with comments about this site.
Copyright © 1997-2022 by Websites Online, Inc., all rights reserved. Text, graphics, and HTML code for this site  are protected by US and International Copyright Laws, and excluding Internet search engines and directories,  may not be copied, reprinted, published, translated, hosted, or otherwise distributed by any means without permission.