CGI Wysardry
Installing Perl CGI Scripts

Installing Matt's Script Archive Guestbook at Spaceports.



Home / CGI / Matt's Guestbook

Back | Next

Overview

This page gives instructions on how to adapt the Guestbook Perl CGI Script from Matt's Script Archive for use at Spaceports.

If you don't already have it, you can get it here.


Before you start

Read the Readme file!

Decide where you are going to put your guestbook - I put all my files in a single directory called gb on the CGI-BIN server.  If you wish to put yours elsewhere, you will have to change the paths accordingly.


Path change

If you signed up for your CGI-BIN account after the end of July 2000, but before the middle of February 2002 you will need to change all references to home in the paths to home2 or the script will not work.

If you received your CGI-BIN account after the middle of February 2002 you will need to change all references to home in the paths to home3 to avoid errors.


guestbook.pl

Remembering to change username to your username, gb to the guestbook directory you are using and you@yourmail.com to your real email address, use the example below as a guideline:-


# Set Variables

use CGI;
use CGI::Carp qw/fatalsToBrowser/;

$guestbookurl = "http://cgi-bin.spaceports.com/~username/gb/guestbook.html";
$guestbookreal = "/home/username/public_html/gb/guestbook.html";
$guestlog = "/home/username/public_html/gb/guestlog.html";
$cgiurl = "http://cgi-bin.spaceports.com/~username/gb/guestbook.pl";
$date_command = "/bin/date";

# Set Your Options:
$mail = 1;        # 1 = Yes; 0 = No
$uselog = 1;      # 1 = Yes; 0 = No
$linkmail = 1;    # 1 = Yes; 0 = No
$separator = 1;   # 1 = <hr>; 0 = <p>
$redirection = 0; # 1 = Yes; 0 = No
$entry_order = 1; # 1 = Newest entries added first;
                  # 0 = Newest Entries added last.
$remote_mail = 1; # 1 = Yes; 0 = No
$allow_html = 1;  # 1 = Yes; 0 = No
$line_breaks = 0; # 1 = Yes; 0 = No

# If you answered 1 to $mail or $remote_mail you will need to fill out
# these variables below:
$mailprog = '/usr/sbin/sendmail';
$recipient = 'you@yourmail.com';

# Done


You will need to refer to the Readme file to know what settings to use for the options section, as that depends on your own needs and tastes.


addguest.html

At a minimum you need to change the following:-

<form method=POST action="http://your.host.com/cgi-bin/guestbook.pl">
to
<form method=POST action="http://cgi-bin.spaceports.com/~username/gb/guestbook.pl">

and

<a href="http://your.host.com/guestbook.html">Back to the Guestbook Entries</a>
to
<a href="http://cgi-bin.spaceports.com/~username/gb/guestbook.html">Back to the Guestbook Entries</a>

Replacing username with your username and gb with the directory you are using, if different.


guestbook.html

You will probably need to change the following line:-

<li><a href="../">Back to My Home Page</a><br>

I changed mine to the full URL for my home page ("http://io.spaceports.com/~wysardry/index.htm")


Uploading

  1. Create any necessary directories and CHMOD them to 755
  2. Upload the files in ASCII mode to the correct directory (gb inside public_html in my case)
  3. CHMOD guestbook.pl to 755
  4. CHMOD addguest.html, guestbook.html and guestlog.html to 777

The result

If all went according to plan, your guestbook should be ready to use.  If you want to see an example of it in use, I still have it here.

It looks a little plain as I left all the HTML files as they were, other than changing the paths.

Site Menu

Sell t-shirts with your design ... for free!

Section Menu


Copyright © 2000-2003 Wysardry

Most recently updated on 11 May, 2003

Home / CGI / Matt's Guestbook

Back | Next


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

This site is hosted by Spaceports