Active Web Hosting Logo

Megabook 2.1 Guestbook

What is Megabook?

Megabook is a CGI guestbook written in Perl which you can add to your site. It will let your visitors leave a message to you that everyone can view. You can also allow them to leave you a private message instead, if they wish. Megabook is fully customizable. The templates are easy to edit for anyone that knows HTML. Even if you do not know HTML code, you can still change the look to easily fit the colors of your web site. Megabook also lets you add up to 6 custom fields, Ban certain IP numbers, edit or delete entries, and censor words. There are many easy to configure options which let you create a guestbook to look and operate the way you want it to.


To use Megabook, you need to be sure your CGI account is set up. Please see How To Request A CGI Account for more information. You will also need to download a copy of Megabook. The version used in this tutorial was 2.1.

Always be sure you have installed the latest updates and/or patches for the script as well as for any additional add-ons. Updates are very important to the security and proper functioning of the script! Our instructions may be for earlier versions of scripts due to the fact that we are not able to keep up with updates to every script at all times. It is still up to the domain owner to install and use the latest version of these scripts.


Remember that only your main account can access CGI scripts on your server. Any hosting or extra FTP accounts that access these scripts may cause your account to be deactivated and you'll have to contact support.

It's best to use a separate directory and leave the cgi-bin directory for your smaller scripts. Megabook contains quite a few files which you'll probably want to keep separate from your other CGI scripts. In addition, some HTML knowledge is useful if you wish to add custom fields, inhibit the posting of the user's browser information to the public, or significantly change the layout.


  1. Extract the files to a directory on your hard drive.

  2. Open the .cgi files in a text editor (not a word processor like MS Word) and be sure that all the files start with #!/usr/bin/perl/ on the first line.

  3. Log on to your CGI server and create a new directory. For this example, we simply made the new directory called guestbook.

  4. Upload all the files to your new directory. Be sure to upload them in ASCII Mode in your FTP program. Please check your FTP program options and documentation to learn how to do this.

  5. Change the file permissions of all the *.cgi files to 755. Change the file permissions of all the *.txt and *.db files to 666. You can log out of your CGI server and close your FTP program when done.


  1. Point your web browser to (where should be replaced with your actual domain name).

  2. At the log in prompt, type in the default password: megabook

  3. Now you're in the Administration Page. This is where you can go through and customize your guestbook. First click on the Change Password link in the Menu area. Type in the password megabook for Old Password. Now type in your new password in the two fields (the second time is to confirm that you spelled your new password right). Be sure to remember your password.

  4. You can configure the other options easily. Each option usually has a description with it to describe it's function. Some of them, like the sendmail email program path, can be left as is.

Layout Configuration & Adding Fields:

If you know a little HTML, you can easily customize your guestbook to look exactly like the rest of your site, add or delete fields, and change the display of the entries. All this is done from the Layouts link in the Administration Menu.

Megabook has 6 custom variables you can use to add fields. These are var1 - var6. We'll show you here how to set up a field for Yahoo! IM. However, you can also add any type of form field, such as radio buttons, check boxes, drop down lists, etc. You may also find it easier to edit the text files in a text editor and then upload the files to your server rather than going through the Layouts page. But you can still make quick changes in the browser as well, if you wish.

In the Footer Layout, type in the following into the table where you'd like the form to be displayed. Note the variable is highlighted. You can use any number variable that you did not already use (ie. var1 through var6).

<td align=left>Yahoo IM:</td>
<td align=right><input name="var3" size=35 value=""></td>

Now, type in the following in the same places in the Preview Layout and Missing Fields Layout:

<td align=left>Yahoo IM:</td>
<td align=right><input name="var3" size=35 value="[var3]"></td>

Note the [var3] is added above. This is so that the user will not have to retype their information when previewing their post. NOTE: Your users will need to submit their post twice. Once to preview and then again to post. You may want to let them know of this somewhere in the Preview Layout page.

Now, in the Entry Layout, make the highlighted change. Note that the code should really be all on one line. It is split up here for easy reading.

<font size=1><b>[name]</b></font>
[<A href=[url] target=_top>Homepage</a>]
[<A href=mailto:[email]>Email</a>]
ICQ: [[icq]] Yahoo IM: [[var3]]
[<a href="admin.cgi?action=modifypost&entryid=[entrynum]">M</a>]

Note we are putting our variable after the [[icq]] and also adding text to make it clear which is which.

When done editing, Click Save Settings at the bottom to save.

To view your guestbook (this would also be the link to your guestbook):

where should be replaced with your actual domain name.

Here are some more tips you may want to consider when setting up your guestbook:

  • Even if you put your variable in Missing Fields layout, it will not be a required field until you check that variable's checkbox in the Required Fields area of the main Administration page. You can leave it unchecked even if you have it in Missing Fields, as you probably should at least put new variables in Missing Fields even if you do not have it selected in the Requirded Fields.

  • If you would like to keep the user's brower information from being posted (some users would prefer you not post this) then you could delete the [browser] tags in the Entry Layout and Preview Layout.

  • To make the text area for your guestbook bigger, change the width in the line:
    <table border=1 cellpadding=0 cellspacing=0 width=400>
    in the Entry Layout, Preview Layout and Missing Fields Layout. You can also eliminate the border by setting border=1 to border=0 instead.


If you have any problems or questions about Megabook, please contact the author at the Megabook web site.

Active Web Hosting may not be able to provide support for this program or it's installation.


Home - Support - Management - About Us
... Active Web Hosting, 213 N Stephanie St G318, NV 89074 ...
(702) 449-2337