Anti-Spam Guestbook - Setup Guide


Anit-Spam Guestbook Script
Version 1.2
COPYRIGHT @ 2005 by Aubrey Millard

How to set up the Script   -   Mesages & Response email


        BAN AND SPAM MESSAGES                                       
 These are the messages that will be displayed to someone who has            
 spammed your GUESTBOOK or been banned.                                       
 HTML tags are OK.                                                            
 Leave the first line as they are and only change the text                    
 inside the quotes " "  YOU MUST HAVE a ; at the end!! You can                
 delete any of the lines that have a .=                                       


 SPAM MESSAGE
$SpamMesg  =  "Your entry has been flagged as SPAM!<BR>";
$SpamMesg .= "<B>We do not allow spam, advertising posts or swearing.<BR>";
$SpamMesg .= "Go mess up someone elses guestbook!</B><br>";
$SpamMesg .= "Your IP address: $ENV{'REMOTE_ADDR'} has been logged and banned.<br><br>";
$SpamMesg .= "If you feel this to be in error please contact the webmaster.";
BAN MESSAGE
$BanMesg  = "<B>Your IP Address ( $ENV{'REMOTE_ADDR'} ) has been banned for spamming the guestbook!</B><BR>";
$BanMesg .= "You are not allowed to post here at all.<BR><BR>";
$BanMesg .= "If you feel this to be in error please contact the webmaster.";
GUESTBOOK ENTRY This is the HTML format for the entry into your guestbook. Format it any way you want. There is a good example here. You can copy and paste one of the formats from the guestbook.html file included in the zip file or create your own. There are some more on the website as well. Here is the list of "special" tags you can use to display things that the person wrote. ** Notice there is a difference between a {} and () ** ** The field name MUST be surrounded by {} and NOT () ** These first few should be self explanitory.... $FIELDS{'name'} $FIELDS{'city'} $FIELDS{'country'} $FIELDS{'howfound'} $FIELDS{'message'} The next couple may need some explanation if you are new to this. $FIELDS{'url'} - this is the persons website if they filled it in. $EMASK - this is the persons email address. How it will look depends on if you set $MASKEMAIL to YES or not. $ENV{'REMOTE_ADDR'} - This is the persons IP Address. ie. 192.168.200.102 ONLY EDIT THE PORTIONS THAT ARE IN GREEN View the HTML file in your browser or look here to see what the different entry formats look like.
sub GetEntry { $FIELDS{'url'}=&CheckURL($FIELDS{'url'}); $SUBMISSION=<<SUBENTRY; ONLY EDIT BELOW THIS LINE!
<TABLE border="0">
 <TR><TD>
	 $DATE <!-- $ENV{'REMOTE_ADDR'} submitter's IP address -->
 </TD></TR>
	 <TR><TD>
		 <b>$FIELDS{'message'}</b>
	 </TD></TR>
	 <TR><TD>
		 <b>$FIELDS{'name'}</b>  $EMASK      
		 <A HREF="$FIELDS{'url'}">HomePage</A> <br>
		 <i>Where are you from? </i>  $FIELDS{'city'}  $FIELDS{'country'}<br>
		 <i>How did you find us?</i>  	$FIELDS{'howfound'}
	 </td><tr>
  </table>
  <HR>
SUBENTRY }DO NOT EDIT THE ABOVE LINE! it will NOT show up in the guestbook. Thank You Email Message Body Format the email message thanking the person for signing your GUESTBOOK. Not a good idea to use HTML here. Not everyone uses Outlook Express. :-) Change the subject line to whatever you want. sub GetThanksMsg { Convert <BR> to CR(\n) $FIELDS{'message'} =~ s/<BR>/\n/g; You can edit this subject line for the email.
  $SBJ = "Thaks for signing my guestbook";
$THANKSMSG=<<ENDMESSAGE; ONLY edit below this line
Hi $FIELDS{'name'},

Thank you so much for visiting our site and signing the guestbook.
We hope you enjoyed your visit and will come back to visit us
soon.

You wrote:

Name:       $FIELDS{'name'}
E-Mail:     $FIELDS{'email'}
City/State: $FIELDS{'city'} $FIELDS{'country'}
Home Page:  $FIELDS{'url'}
How Found:  $FIELDS{'howfound'}
Message:    $FIELDS{'message'}
ENDMESSAGE } DONT edit the above line. it will not show up in the email msg. Notify Email Message Body Format the email message you will recieve if someone signs the guestbook. <BR> tags will be converted to \n so it will look right in the email message. Change the subject line to whatever you want. sub GetNotifyMsg { Convert <BR> to CR(\n) $FIELDS{'message'} =~ s/<BR>/\n/g; You can edit this subject line for the email.
  $SBJ = "Someone signed your guestbook";
$NOTIFYMSG=<<ENDNOTIFY; ONLY edit below this line
$FIELDS{'name'} signed your guestbook!

Here is what they wrote:

Name:       $FIELDS{'name'}
E-Mail:     $FIELDS{'email'}
City/State: $FIELDS{'city'} $FIELDS{'country'}
Home Page:  $FIELDS{'url'}
How Found:  $FIELDS{'howfound'}
Message:    $FIELDS{'message'}
ENDNOTIFY } DONT edit the above line. it will not show up in the email msg.
Back to Variables   ||   Next HTML