AdvancedNetworkHosts | Hosting Made Simple! Call Toll Free 1.866.203.9373 / 630.221.8451
Web HostingDedicated ServersResellersOrder Now!
HOME | ABOUT US | SERVICES | SUPPORT | CONTACT | SITE MAP
Back to SUPPORTBack to ONLINE MANUAL INDEX Go to Previous Page
     
 
ONLINE MANUAL
Chapter 6. Your Own CGI-SCRIPTS
        6.2 IMPLEMENTING CUSTOM CGI SCRIPTS

Our UNIX web servers have the capability to run CGI scripts in your very own "cgi-local" directory. Put your CGI programs in the cgi-bin directory. When calling the programs from the web page, you must use the alias for the cgi-bin directory. The alias is "cgi-[yourdomain]". If your domain is example.com, then the alias is cgi-example. Note that ".com" is not included. So the action line from your form page would look like action="/cgi-example/program".

Put your CGI programs anywhere outside of the cgi-bin directory. In this case, the program name must end in ".cgi".

Shell Scripts

Upload to your cgi-local directory to ensure proper file permission settings. Upload in ASCII transfer mode (and NOT BINARY mode). The first line of each script must read: #!/bin/sh , #!/bin/csh. Reference the script using /cgi-local (and NOT /cgi-bin) Always remember to include echo "Content-type: text/html\n\n"

Perl Scripts

Upload to your cgi-local directory to ensure proper file permission settings. Upload in ASCII transfer mode (and NOT BINARY mode). The first line of each script must read: #!/usr/local/bin/perl

Reference the script using /cgi-local (and NOT /cgi-bin). 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();

Paths to Date, Sendmail, Perl, etc

Sendmail: /usr/lib/sendmail

Perl5: #!/usr/local/bin/perl

Serverpath: /home/username/domain-www/cgi-bin

Root path: /home/username/

(puts you in your the root of your account)

Domain directory: /home/username/public_html

(puts you in your public_html directory)

Cgi-bin path: /home/username/public_html/cgi-bin/filename

(puts you in your cgi-bin)

Back to SUPPORTBack to ONLINE MANUAL INDEX Go to Previous Page
 
Email Sales or Call Toll Free: 1.866.203.9373 / 630.221.8451
Web Hosting | Dedicated Servers | Resellers | Services | Order Now!
Home | About Us | Support | Contact | Partners | Site Map | Privacy Statement | Terms of Use
Copyright © 2000-2003 AdvancedNetworkHosts. All Rights Reserved.