Script Wysardry
Adapting Perl CGI Scripts

Perl CGI Script Tutorial 6 - A Script At Last.



Home / Script / Tutorial 6

Back | Next

The Next Stage

If, and only if, you have read the previous sections and actually managed to get the script to run are you ready to move on.  You cannot rush ahead with Perl and CGI, so if you haven't already done that, go back and try again.  There is no way to move on until you have mastered both file permissions and uploading in different formats - no scripts will run until you have.


A script at last

Start up your FTP program and connect to your CGI-BIN account.

We are now ready to work on adapting an existing freeware script together.

For this I decided to use BigNoseBird.com's BNBFORM All-In-One Form Processing Script.  The reasons for this are:-

  1. A form processing script is a useful thing to have.
  2. This version is very adaptable.
  3. It introduces you to the two server concept.
  4. It has multiple files, but not too many to handle.
  5. When you have mastered this, moving on to a bigger script will be easier.
  6. I hadn't given instructions for a form script before now.

The first steps

You will need to download the script from here. If you already have a copy, make sure it is V4.0 (Updated January 31, 2000) before starting.


Unzip the files.

They unzip to a directory called bnbform by default, and there's no reason to change that as far as I can see.


Read the readme.

Open up the readme.txt file and read at least enough of it to understand how the program works and what it does.  There is no point in me repeating much of the content in there, and indeed I am not going to.

New users: If you signed up for your CGI-BIN account after the end of July 2000 you will need to change all references to home in the paths to home2 or the script will not work.


Manipulating the files.

I suggest that you make a directory called bnbform inside whatever directory you use for both the CGI-BIN server and the 'planet' server. I have a separate directory for both of these, and it makes life much easier that way.

To put it another way, you should have 2 directories, something like this:-

/portsweb/bnbform
/portscgi/bnbform

The reason for this is that the HTML files really belong on the 'planet' server as they don't require SSI or anything fancy to work.  If you set it up this way, you will be able to include the form in any of your pages on the 'planet' server with a lot less trouble.


Copy (don't move) the following files into the bnbform directory in the 'planet' server directory on your hard drive:-

bnbform.html
oops.html
thanks.html


Copy (don't move) the following files into the bnbform directory in the CGI-BIN server directory on your hard drive:-

bnbform.cgi
mymessage.baut

You should now have a directory structure like this:-

/portsweb/bnbform/bnbform.html
/portsweb/bnbform/oops.html
/portsweb/bnbform/thanks.html


/portscgi/bnbform/bnbform.cgi
/portscgi/bnbform/mymessage.baut

In case you are wondering, I told you to copy the files rather than move them so that you would always have originals to refer to without needing to unzip them again. This is a good habit to get into.

Site Menu

Bravenet

Section Menu


Copyright © 2000-2003 Wysardry

Most recently updated on 11 May, 2003

Home / Script / Tutorial 6

Back | Next


Please feel free to contact us with any comments or suggestions
Adapting Perl CGI Scripts
Script Wysardry

This site is hosted by Spaceports