|
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
- Create any necessary directories and CHMOD them to 755
- Upload the files in ASCII mode to the correct directory (
gb inside
public_html in my case)
- CHMOD
guestbook.pl to 755
- 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.
|