navigation
Thomas Brunt's OutFront Hosting
 
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Microsoft MVP
 

Installing and Using Perl Scripts - Part IV 
by Outfront Moderator Katherine Nolan (abbeyvet)

Configuring and Installing Your Script


Once you have downloaded and unzipped the script take a few minutes to look at the files you received, which should now be in your Poll Script folder.

Most scripts comprise a number of files in addition to the actual Perl scripts, image files, text files, html files and so on, that work with the script to display your pages. In this case you have in the main folder the following files (the ones we will be uploading and working with are in red):

  • image.gif
    This is an image that is used to display your user votes in an attractive manner.

  • INSTALL_Poll_It_v2.05
    This is a text file containing installation instructions. For the moment ignore this - use our installation instructions instead, especially if this is your first installation. 

  • LICENSE_Poll_It
    The license, which you should read. If you are having problems opening this choose to open it in Notepad.

  • Poll_It_SSI_v2.05.cgi
    A Perl script file that allows you to include your poll in an existing page using Server Side Includes. Since we are not going to do that, initially anyway, you can ignore this one for the moment.

  • Poll_It_v2.05.cgi
    This is the script that will make it all happen!

  • pollit_files Folder
    There is also a folder called pollit_files containing a mixture of HTML files and text files.

    • The text files are used to store information about your polls and display it to users. If you open them now they will be blank, this is as it should be. 

    • The HTML files control how your polls will look on your site. When we come, next week, to customizing your script for your site we will look at the possibilities of editing some of these but for now just leave all the files in this folder as they are.

Configuring the Script

The only file you need to configure is the Poll_It_v2.05.cgi, so open this in Notepad or whatever text editor you will use. NOT in FrontPage!

I will be installing on my server at http://www.inkkdesign.com so will use that as the sample for the configuration steps below. Obviously you will replace your URL for mine.

Configuration Steps

1. The Path to Perl

This is the very first line of the script and reads:

#!/usr/local/bin/perl 

You should know the path to perl on your server after last weeks article, if this is it no change is needed. If your path is:

#!/usr/bin/perl 

edit this line carefully to read correctly.

2. Editing Variables

These variables tell the script about things that are specific to your server, your site or which are dictated by your own preferences. Variable names in Perl are indicated by the $ sign - never edit names these in any way. The only bits you edit are after the = sign. You must also be careful to retain the parentheses and the semi colons in the variables intact. There are just a few to specify here:

a. $admin_password = "protection";

Choose whatever password you like, but do change it from the default. Make sure you leave the parentheses intact and use only letters and numbers. Maybe I used the password below, maybe I didn't!

$admin_password = "abbeyvet";

b. $image_url = "http://www.your-url/image.gif";

This is where you need to specify where on your site the image that came with the script will be placed. The easiest thing to do is place it in the main images folder at your site. So you would amend this variable to read (in my case):

$image_url = "http://www.inkkdesign.com/images/image.gif";

c. $vote_text = "Rock the Vote!";

Simply the text that will appear on the button to allow people to vote.

$vote_text = "Vote Now!";

d. The final three variables are just for text that will appear in your poll pages:

$last_poll_text = "<LI>View our Previous Polls Results";
$results_not_available = "<BR>The results will be posted soon...";
$poll_not_available = "<BR>Currently there is no opinion poll available...<P>Check back soon for another poll...";

When a variable contains some HTML tags, as these do, you should be very careful not to disturb it when you edit the variable. You can add additional HTML but do not do so for now. I did not edit these variables at all; you can change the wording if you wish.

That's the configuration taken care of - now lets get it up there and working!

Uploading your Script

These instructions assume you are using WS_FTP, if you are using another FTP client the procedure will be much the same.

1. Fire up WS_FTP
In the Local System window - on the left - navigate to your script files on your local computer. 

2. In the Remote System window - on the right - navigate first to your images folder. Making sure you have Binary mode selected (below the two file windows) select the files image.gif from your computer and upload to your images folder.

3. IMPORTANT: Change the upload method to ASCII once this is done. Perl scripts MUST be uploaded in ASCII format.

4. Navigate to your cgi-bin directory, whatever it is called. In my case it is called cgi-local. Make a new directory in the cgi bin by selecting 'Mk Dir' on the right of your screen and call it 'poll' - note lower case. Double click on this new directory to open it.

5.
Upload the file Poll_It_v2.05.cgi to the 'poll' directory.

6.
Inside the 'poll' directory make a new directory, as above, and call it 'pollit_files'. Open it.

7.
Upload all the files in the 'pollit_files' directory on your computer to the new one of the same name on the server.

That's it - your script is on your server. Now you need to set permissions for it. Oh no! I hear you say - this is the tricky bit! Well, tricky perhaps if you have not done it before but it is not difficult if you just take a few minutes out to learn how it works.

 

<< Part III: Finding and Evaluating a Script
>> Part V: Setting Permissions

 

Fun With Background Images
Fun With Bulleted Lists
Are You Compliant?
Introduction To Cascading Style Sheets
Creating Custom Error Pages
Designing Fast Loading Sites
Creating Funky Forms With CSS
htaccess Magic
An Introduction To JavaScript
JavaScript Snippets
Getting More From Mailto
Installing And Using Perl Scripts
Preparing Photos For Your Web Site
The Popup Dilemma
Paint Shop Pro Album 4
Creating And Using robots.txt File
Creating JavaScript Rollover Buttons
 

Microsoft Corporation in no way endorses or is affiliated with "OutFront." 
OutFront is published and edited by Thomas Brunt
440 Great Circle Dr., St. Matthews, SC 29135.  803-655-6151
© 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 All Rights Reserved
Click here to view our privacy statement.