How to Install a CGI Script and Increase Web Site Interactivity

Written by Herman Drost


You may have delayed cgi script installation duerepparttar 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 processesrepparttar 134396 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 onrepparttar 134397 Net. Just do a search on Google for "free cgi scripts" or visitrepparttar 134398 resources atrepparttar 134399 end of this article.

We will create an html email form to collectrepparttar 134400 name, email address and comments of subscribers using a secure cgi formmail script. An automatic confirmation will be sent andrepparttar 134401 results ofrepparttar 134402 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 onrepparttar 134403 server. The cgi-bin is a special directory inrepparttar 134404 server where allrepparttar 134405 files which require security are kept. This is where you will upload your cgi script once it has been modified.

2. Downloadrepparttar 134406 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. Readrepparttar 134407 documentation that comes withrepparttar 134408 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. Removerepparttar 134409 html tags fromrepparttar 134410 script (atrepparttar 134411 top and bottom).

6. Changerepparttar 134412 path to perl to: #!/usr/bin/perl -wT (this isrepparttar 134413 first line ofrepparttar 134414 script to be edited).

7. The section ofrepparttar 134415 cgi script shown below, arerepparttar 134416 other minimum fields to fill out inrepparttar 134417 script (replacerepparttar 134418 fields inrepparttar 134419 script you downloaded withrepparttar 134420 changed fields inrepparttar 134421 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. Ifrepparttar 134422 purpose of these # parameters seems unclear, please seerepparttar 134423 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

How Multiple Server Hosting impacts your website's uptime

Written by Godfrey Heron


Please considerrepparttar following article for your ezine, ebook or web site. It is free to use as long as you includerepparttar 134395 resource box atrepparttar 134396 end. It contains 792 words. If you use this article, please send a brief message to let me know where it appeared. info@irieisle-online.com

Article available for reprint: godfreyh@irieisle-online.com ==================================================== Hosting of web sites has essentially become a commodity. There is very little distinguishing one hosting company fromrepparttar 134397 next. Core plans and features arerepparttar 134398 same and price is no longer a true determining feature. In fact, choosing a host based onrepparttar 134399 cheapest price can be more expensive inrepparttar 134400 long term with respect to reliability issues and possible loss of sales as a result of website downtime.

Selecting a host fromrepparttar 134401 thousands of providers and resellers can be a very daunting task, which may result in a hit and miss approach. But although hosting may have become a commodity, one distinguishing feature that you must always look out for is reliability.

Atrepparttar 134402 heart of any hosting company's reliability is redundancy. This ensures that if a problem exists at one point, there will be an alternative which ensures continuity as seemlessly and transparently as possible.

Most hosts do employ redundant network connections. These arerepparttar 134403 high speed pipes that route data fromrepparttar 134404 server to your web browser. But, redundant 'multiple web servers' have been extremely rare and very expensive, requiring costly routing equipment which has previously been used only in mission critical applications of Fortune 500 companies.

However, a very neat but little known Domain Name Server(DNS) feature called 'round robin' allowsrepparttar 134405 selection and provision of a particular IP address from a 'pool' of addresses when a DNS request arrives.

To understand what this has to do with server reliability it's important to remember thatrepparttar 134406 Domain Name Server (DNS) database maps a host name to their IP address. So instead of using a hard to remember series of numbers (IP address) we just type in your web browser www.yourdomain.com, to get to your website.

Now, typically it takes at at least 2 to 3 days to propagate or ‘spreadrepparttar 134407 word’ of your DNS info throughoutrepparttar 134408 internet. That's why when you register or transfer a domain name it isn't immediately available torepparttar 134409 person browsingrepparttar 134410 web.

This delay has stymiedrepparttar 134411 security benefits of hosting your site on multiple servers, as your site would be down for a couple of days if something went awry with one server. You would have to change your DNS to reflect your second server and wait days beforerepparttar 134412 change was picked up in routers onrepparttar 134413 internet.

Cont'd on page 2 ==>
 
ImproveHomeLife.com © 2005
Terms of Use