Guestex Installation
########################################################
#                     Guestex 1.0                      #
#               By Thomas Tsoi 25.7.99                 #
#                webmaster@cgi.com.hk                  #
########################################################
#                                                      #
# CGI.com.hk:                                          #
#   http://www.cgi.com.hk/                             #
#                                                      #
# #################################################### #
#                                                      #
# You can distribute this script and use it freely as  #
# long as this header is not edited in the script.     #
#                                                      #
########################################################
Installing Guestex is easy.
Follow the following steps, you shouldn't get big troubles.

1. Editing the path to Perl interpreter
- In the first line, you can see #!/usr/local/bin/perl, this is the location of the Perl interpreter, in most cases this needn't be changed. However if you are not sure what the location is, you can telnet to your server, type which perl and it will show you the path.

2. Editing options
The following are the options available in Guestex. Open guestex.cgi and edit them with your favourite text editor.

$script
# URL of guestex.cgi

$guestex
# Path to the core part of Guestex, guestex.pl

$guestdata
# Path to the data file

$header
# Path to the HTML header

$footer
# Path to the HTML footer

$rec_temp
# Path to the Record template

$sendmail
# Location of sendmail

@required
# Define the required fields

$perpage
# Number of records per page

$allow_html
# Allow guests to use HTML?
# Set to 1 to allow, 0 not to allow

$autolink
# Enable auto linked hyperlinks
# Some problems may occur if HTML is enabled and
# people put a link in HTML themselves
# So it is suggested not to enable this if HTML if enabled
# Set to 1 to allow, 0 not to allow

$greeting
# Send email to guests who have signed your guestbook
# Set to 1 to enable, 0 not to disable

$notify
# Send email notification when there's a new entry
# Set to 1 to enable, 0 not to disable

$from_name
# The name associating with $from_email which appears in the mail header
# This is usually your name or your site's name

$from_email
# Your email address

$gph_rating
# Enable graphical rating
# Set to 1 to enable, 0 not to disable

$rating_2p
# URL of the 2-point image

$rating_1p
# URL of the 1-point image

$filter
# Domain filter, strongly recommended to set this to your server
# Set to 1 to enable, 0 not to disable

@domains
# Domain filter, strongly recommended to set this to your server
# So that people cannot edit the submission form to perform any unwanted actions
# For multiple domains, write like this -> ("astronomy.org.hk", "anothersite.com")

$time_format
# Time format
# [WD] : Weekday, e.g. Monday
# [dd] : Day in numeric, e.g. 23
# [DD] : Day in text, e.g. 23rd
# [mm] : Month in numeric, e.g. 9
# [MM] : Month in text, e.g. September
# [yy] : Year in 2 digits, e.g. 99
# [YY] : Year in 4 digits, e.g. 1999
# [sec] : Second in numeric, 12
# [min] : Minute in numeric, 44
# [hr] : Hour (12-hour clock)
# [HR] : Hour (24-hour clock)
# [am] : am/pm

$homepage
@weekdays
@months
# Not necessary to be changed

$msg_greeting
# Greeting Email Message

$msg_notify
# Notification Email Message

3. Editing the record template
The record template (by default, record.txt) defines how the guestbook should look, you can add as many/few fields as you like. To add a field, simply write [%%field%%] where field is the field name. It is actually the name you submit in your guestbook form. REMEMBER, it is case-sensitive.
There are, however, two predefined special tags which lets you to add the link to the guest's homepage and to display the time when the guest signed it.
[%%homepage%%] - If both site and url are present, it is defined as <a href="url">site</a>. If only url is present, it is defined as <a href="url">url</a>. If none is present, it will display "N/A".
[%%time%%] - Display the time in the format defined in $time_format

4. Installing cgi-lib.pl
Download cgi-lib.pl if you don't have it. Place it in the same directory with quirex.cgi and set its permission to 755.

5. Setting permissions
Upload all the files. Set their permissions as shown below:

chmod 755 guestex.cgi
          guestex.pl

chmod 666 guestex.dat

chmod 644 header.txt
          footer.txt
          record.txt

6. Writing the submission form
With Guestex, you can add as many fields in your guestbook as you like. However, there are certain predefined fields which will be processed with additional validation, they are:
name - Name of the guest
email - Email of the guest, will be checked whether it is in a valid format
site - Name of the homepage of the guest
url - URL of the homepage of the guest
rating - Rating to your site, or whatever you like. If $gph_rating is set to 1, it will be presented with pictures instead of numbers
comment - Comment of the guest, if $autolink is set to 1, archors will be added to hyperlinks automatically

Hints

- Method POST is strongly recommended

- You can view the guestbook with the URL
http://www.mysite.com/cgi-bin/guestex.cgi?page
where page is the page number
Copyright © 1999. All rights reserved.