Anit-Spam Guestbook Script
Current Version 3.30
COPYRIGHT @ 2005,2006 by Aubrey Millard
How to set up the Script
This script was created with the novice user in mind. If you use most of the defaults then
you can configure this script in just a few minutes. The script and the way it displays is
highly configurable, so it can be very unique if you want to play with the different formats.
We will go into more detail as we go along. First we will look at getting the script running.
After that we will get into the customization.
BEFORE you start to try to set up this script make sure you know the following things.
1. The location of PERL on your server ie. /usr/bin/perl or C:/perl/bin/perl.exe
2. the PATH to your website ie. http://www.somedomain.com/~mysite/
Also
If you want to use the email options with this script you will need to know...
1. The mail program and it's location ie(Linux) /cgi-bin/sendmail or (Windows) C:/www/cgi-bin/blat.exe
2. Your email login information username/password (you can get this from your email client)
3. Your email server address and port. Again you can get this from your email client
OK, if you know or have handy the above information let's jump in.
I assume that you have the script downloaded and unzipped on your computer somewhere.
(If not go to the Downloads section and get it now)
In Notepad open up the file called asgbv3.pl. This is the script file that does all the work.
BE VERY CAREFUL when editing this file!!!! If you accidently delete something as simple as
a "; " it could cause the script to fail.
So now we have the script open in Notepad, here is what we should see.
#!C:/perl/bin/perl.exe
$|=1;
#
# Anti Spam Guestbook
# Version 3.30 03/05/06
#
# COPYRIGHT @ 2005,2006 by Aubrey Millard
# nospam@combatarts.ca
################################################################################
# #
This is the headder of the file. Anything with a # in front of it is just a comment and doesn't
actually do (with some exceptions) anything but provide you the reader with some information. The code is heavily commented
so feel free to browse through the script to see how PERL works....Just not right now, we have a script
to set up!
The first line is VERY important.
#!/usr/bin/perl
Depending on which distribution you downloaded this might look a little different.
This tells the script where to find the PERL executable. This is the line that can cause some users some real headaches.
The #! must be there with NO spaces at the beginning!!
#!C:/perl/bin/perl.exe <== OK
#!C:/perl/bin/perl.exe <==NOT OK, has a space at the beginning
Ok, so lets go ahead and fill in the PERL path (Dont guess! Not every server is set up the same.)
Some examples:
#!C:/perl/bin/perl.exe <==Windows
#!/usr/bin/perl <== Linuix/Unix
On Windows systems running IIS this is not used so you don't have to worry about it.
Now you are going to have to tell the script where these files are. Scroll down and find the lines that read:
############# These lines have to point to your installation ###################
################################################################################
require "/var/www/cgi-bin/dbase.pl";
my $TEMPFOLDER="/tmp/";
my $DATAFOLDER="/www/cgi-bin/";
The first line needs to point to location of the dbase.pl file (Should be the same directory as the other script files).
The second line HAS to point to a directory where files can be created /tmp/ on linux and C://Temp// on Windows will usually be ok.
The third line must point to the location of the datafiles. If you choose a location that has permission to create files then the script will create them the first time you run the script.
If you can't use a directory that allows file creation then you will have to place the files from the datafiles archive in the directory that you choose to use.
DO NOT use a directory that can be accessed from a web browser like in a folder on your website!
Once you have done this then open up the file asconfig.pl and do the same thing.
You must now repeat this process for the asconfig.pl file.
Now open the file called dbase.pl. Find the line that reads:
my $TEMPFOLDER="C://Temp//";
and change this to the location of a folder that you can create temp files, usually C://Temp// or /tmp/
Once you have completed these steps upload all the files to the proper locations on your server.
You can then run the configuration script from your browser and set everything up.
NOTE: If you have problems running the script, such as "Premeture end of headers" or "500 Internal Server Error"
then you may have inserted CL/LF with the text editor that the server is having a problem with (Linux/Unix servers).
To fix this reference this
solution
Once you have done this to the asgbv3.pl file, open the file asconfig.pl into NOTEPAD and do the same thing.
Using your favorite FTP program log in to your FTP server and upload these files into the specified locations.
asgbv3.pl cgi-bin directory
asconfig.pl cgi-bin directory
dbase.pl cgi-bin directory (v 3.10 and up)
data files cgi-bin or directory that you choose.
ColorPicker2.js your html directory
Once these files are uploaded to the server you should be able to run the configuration script.
Open your web browser and type in the address to the script
ie. http://www.mydomain.com/cgi-bin/myprofile/asconfig.pl
The script page should open and prompt you to log in. The default username is user and the
default password is nospam .
The next page is the Main page, from here there are links to setup and modify the guestbook.
The FIRST thing you need to do is to change your username and password!
Enter a new username and the current password, then in the 2 boxes below enter your new password twice.
Click on the CHANGE button and the script will inform you if the change was sucsessful. Remember, usernames
and passwords are case sensitive.
Once you have changed your password we can now start to set up the script.
The first time you run the script it creates all the default files in the same folder. (only if the doirectory has create permissions)
Do NOT modify these files by hand only use the script! There are some exceptions but we will get into that later.
If you accidentally delete a file don't panic, the script checks the files everytime it's run and if it finds
one missing it will create another default file. If you don't have permissions like on IIS you can get one of the default files from the datafiles.zip archive.
Most of the Setup pages are self explanitory but we will give a brief overview of each here.
Setup Script Variables
This page sets all the information the Guestbook script needs to run.
Holding the cursor over the variable title will show a brief description of what it does.
For a detailed explanation of each on go
here.
Setup Messages
These are the messages that will be shown to a user that has been:
BANNED (Ban Message)
Caught spamming by filter (Spam Message)
Caught leaving junk like multiple links or exceeding the char repeat limit (Junk message)
Edit these to say whatever you want, HTML is ok. You can view a prieview before you save the settings.
Entries/Email
This screen allows you to setup the:
Guestbook entry format
Thank You email
Notification email
It's not a good idea to use HTML in the email messages as not everyone uses the same email client.
For the Guestbook entry format you can create your own, use the default or go here to get other formats.
Additional Guestbook formats
Guestbook Colors
This is the basic guestbook editor. It will show you a preview of the guestbook.
You can change the color scheme to match your website. You can also change the
backgrounds, title and images. The colors can be entered manually or you can click on the
Color Picker link. If the color picker doesn't work make sure that you have set the HTML
folder properly in the variables section and that the ColorPicker2.js file is there.
Addguest page setup
This section will allow you to set the Title and any instructions you
want to display on the submission page.Will also show you a preview
of how it will look with the current color scheme.
From here you can also change the raw HTML to change the look or language.
HTML Advanced Editor
This section allows you to edit the raw HTML of the Guestbook template.
Only use this if you know what you are doing!
The <!--SPLIT--> line denotes the area where the entries will be placed.
any variables surrounded by [ and ] are filled in by the script.
Setup Error Messages
These are just basic error messages the script will show when there is a problem.
You only really have to edit these if you want to have them in a different language
other than English.
Setup Wrod Filter
From here you can edit the word filter file. The default file works well but there may be words that
you want to add and some you may wish to delete. For more info on setting up the word filter go here.
Setting up a word Filter
Setup Blank Insertions
If someone does not enter a city and country when they submit to the guestbook the script
will insert one of these sayings in place. HTML is OK and only one entry per line.
If you don't want to use this feature just delete all of the sayings from this file.
Setup Must Have Word File
From here you can edit the MUST HAVE word file. The default file works well but there may be words that
you want to add and some you may wish to delete. This file is used in conjunction with the MINWORDS variable.
ie. If MINWORDS is set to 2 then atleast 2 ocurrences of any word in the MUST HAVE file
must be in the post.
It's a good idea to only use words that are very common like: is, at, the,and etc.
Good function for preventing junk messages.