Domain Hosting Services
Hostgator
$9.95
5000 MB - 75 GB
Host Unlimited Sites
Anhosting
$6.95
35,000 MB - 750 GB
Unbeatable Features
Startlogic
$5.95
35,000 MB - 750 GB
Cheapest Hosting
Aplus
Fr $99
99.99% uptime - 24x7 support
Interland
Fr $299
Award winning - 24x7 support
Hostgator
$174
Free Setup - Server Management
HOME
CONTACT
SITEMAP
  Top Unix Web Hosting Top Dedicated Web Hosting
 
Top Rated Hosts
 
1 WebHostingPad.com
Host 1200 websites and free marketing package
1200GB - 1200GB - $5.95
Read Review
2 StartLogic.com
Bonus include free web builder and domain.
600GB - 6000GB - $6.95
Read Review
3 BlueHost.com
Host 6 websites with tons of features
30,000MB - 750GB - $7.95
Read Review
4 Hostgator.com
Host Unlimited websites in Baby Plan.
5000MB - 75GB - $9.95
Read Review
5 Anhosting.com
Host 20 websites and 24/7 phone support.
35,000MB - 750GB - $6.95
Read Review
Featured Partners
Web Development Resources
Merchant Accounts
Cheap Web Hosting
Free Website Templates
Reseller Hosting
Free Webmaster Resources
Kiwis Graphics & Templates
Web Hosting Companies
Cheap Web Hosting Reviews
Business Website Hosting
China Domains
Web Hosting Chat
Domain website hosting
Cheap Dedicated Server
Web Hosting Reviews
Free Web Hosting
 
Advertisement
EDI

 

How to Install a CGI Script

You may have delayed cgi script installation due the apparently complex process. Well, I avoided it also for several years, however if you want to increase your web site's interactivity it's a necessity to know how to do it. It's not hard to learn and you don't have to be a programmer.

What is CGI ?

Common Gateway Interface or CGI is a program that can interact with an html form on your web site, and processes the results on your server using a cgi script. The result generated is a dynamic web page. The cgi script is written in a language called PERL ("practical extraction and reporting language").

Uses of CGI scripts

CGI scripts are most commonly used for creating user interaction with a html form on your web site. Other uses include: autoresponders, shopping carts, counters, mailing list managers, ad management, surveys, polls, discussion boards, content management, calendars and click tracking.

There are 100s of free cgi scripts that can be found on the Net. Just do a search on Google for "free cgi scripts" or visit the resources at the end of this article.

We will create an html email form to collect the name, email address and comments of subscribers using a secure cgi formmail script. An automatic confirmation will be sent and the results of the email form will be passed on to your email address.

Steps to installing your own cgi script

1. Check that your web host supports CGI - your web host will have a cgi-bin folder installed on the server. The cgi-bin is a special directory in the server where all the files which require security are kept. This is where you will upload your cgi script once it has been modified.

2. Download the cgi script - this is a secure cgi formmail script. Spammers can't access and harvest your email address from this script.

http://nms-cgi.sourceforge.net/formmail.zip

3. Read the documentation that comes with the script - this will give you a thorough understanding what changes you need to make to have it work correctly with your web site and server. It will also provide you with some examples.

Editing your script

4. Open and edit your cgi script using notepad (don't use an html editor as this can create errors).

5. Remove the html tags from the script (at the top and bottom).

6. Change the path to perl to: #!/usr/bin/perl -wT (this is the first line of the script to be edited).

7. The section of the cgi script shown below, are the other minimum fields to fill out in the script (replace the fields in the script you downloaded with the changed fields in the script below).

# USER CONFIGURATION SECTION
# --------------------------
# Modify these to your own settings. You might have to
# contact your system administrator if you do not run
# your own web server. If the purpose of these
# parameters seems unclear, please see the README file.
#
BEGIN
{
$DEBUGGING = 1;
$emulate_matts_code= 0;
$secure = 1;
$allow_empty_ref = 1;
$max_recipients = 1;
$mailprog = '/usr/lib/sendmail -oi -t';
$postmaster = 'youraddress@yourdomain.com';
@referers = qw(yourdomain.com);
@allow_mail_to = qw();
@recipients = ();
%recipient_alias = ('siteowner' => 'youraddress@yourdomain.com',);
@valid_ENV = qw(REMOTE_HOST REMOTE_ADDR REMOTE_USER HTTP_USER_AGENT);
$locale = '';
$charset = 'iso-8859-1';
$date_fmt = '%A, %B %d, %Y at %H:%M:%S';
$style = '';
$no_content = 0;
$double_spacing = 1;
$wrap_text = 0;
$wrap_style = 1;
$send_confirmation_mail = 0;
$confirmation_text = <<'END_OF_CONFIRMATION';
From: youraddress@yourdomain.com
Subject: Subject of Your Contact Form

(short note here->> )Thank you for your interest. We will respond shortly.

END_OF_CONFIRMATION
#
# USER CONFIGURATION << END >>
# ----------------------------
# (no user serviceable parts beyond here)
--------------------------------------------------------------------------------

$postmaster = Who's sending the email
@referrers = Domains that are allowed to host the script
%recipient_alias = Whom the script will send email to

In my form:


method="POST">


You can see how the siteowner variables match up in the .pl script and in my form. This way, nobody can tell what address the form is being emailed to!

8. Rename your cgi script - name your script something else besides formmail (ie contactus.pl), as this is the most common name people use. This will prevent spammers from harvesting your email address.

9. Create your html form (contactus.htm).

 
Featured Dedicated
Aplus.net
Hosting fr $99/mo - Uptime @ 99.99% - 24x7 support
Host Gator
Hosting fr $174/mo - Free Setup with Server Management
ServerPronto
Cheap hosting fr $29.95/mo - Uptime @ 99.999% - 24x7 support
Hostway
Hosting fr $179/mo - Linux/Windows Servers - Nnetwork uptime @ 99.99%
Featured VPS
Apollohosting
Hosting fr $31.96/mo - 2500MB Space - 100GB Transfer
WebsiteSource
Hosting fr $34.96/mo - 3000MB Space - 120GB Transfer
WestHost
Hosting fr $6.95/mo - 1000MB Space - 20GB Transfer
ServerPlex
Hosting fr $49.95/mo - 10GB Space - 200GB Transfer

Web Hosting Glossary
A

Alias

B Bandwidth
C

C+/++

D

Database

E

E-Business

F

Fault Tolerance

G

Gateway

H Hit
I

IGMP

J JavaScript
K

Kilobyte

L

LAN Modem

M

MAC

N Name Servers
O

ODBC

P Packet Switching
R

RAID

S Scripting Language
T Tape Backup
U

UNIX

V

Veronica

W

Webmaster

X XHTML
Y

YMODEM

Z

Zend


Web Hosting Hosting Articles Hosting FAQ Domain Name Articles Domain Name FAQ Contact Resources
Copyright © 2003-2008 HostingChecker.com