Welcome to Dagon Design. In addition to free scripts, WordPress plugins, and articles, we offer a variety of services including custom theme design, plugin creation, and PHP scripting. Contact me for more information.

Version 2.44   Updated Friday, July 27th, 2007 at 8:20pm

Secure Guestbook Script with Image Verification

This is the latest version of my secure PHP guestbook script. A lot of new features have been added since the last release including support for entry moderation, separate configuration and language files, improved code and session handling, and much more. The purpose of this script is to provide an easy to use, yet secure guestbook which features image verification to keep out spam bots as well as other security measures. It uses a flat-file storage method so that it will work for users without database access and contains many other features not found in most standard guestbook scripts.

Download

Included Languages

The script current includes files for the following languages:

  • English
  • Dutch
  • Formal German
  • French
  • Italian
  • Norwegian
  • Portuguese
  • Romanian
  • Spanish
  • Swedish
  • Turkish

Please let me know if you would like to contribute a new language file!

See it in action

I have a demo guestbook here: Demo guestbook

Installation

  • Download ddgb.zip and uncompress
  • Upload all files into a directory of your choosing
  • Give write-access to /dat/.entries and /dat/.banlist (chmod 666 or 777)
  • Configure the options in config.php
  • Run the script by calling ddgb.php

Changelog

  • 07-27-07 Version 2.44 - PHP short-tag bug fixed. Italian language file added.
  • 06-20-07 Version 2.43 - File locking feature is now an option (disabled by default), instead of automatically enabled
  • 06-13-07 Version 2.42 - Security update
  • 04-04-07 - Spanish language file has been added
  • 03-24-07 - Romanian language file has been added
  • 01-14-07 Version 2.41 - Fixed bug related to display of entries
  • 11-01-06 Version 2.4 - Moderation/display issues 100% resolved - Smilies are now clickable - Various bug fixes
  • 10-22-06 Version 2.31 - Further improvements to the session code - Should work better on Windows servers now
  • 10-21-06 Version 2.3 - Fixed bug with display of entries when moderating - Improved session code - Dutch language file has been added
  • 10-17-06 - Not a version update - Swedish and Portuguese language files have been added
  • 09-07-06 Version 2.2 - Bug fixed (verification problems in non-standalone mode)
  • 09-01-06 Version 2.1 - Various minor fixes - Added Norwegian language file
  • 08-24-06 Version 2.0 - This is a very big update. Because of this, almost all of this page has been rewritten. Unfortunately, previous data files will not work with this release because of the new data structure. The advantage is that new fields can be added in the future without loosing the old data! The new data file is also simple enough that you should be able to manually add your old entries into it. New features include:
    - Separate config and language files
    - Option to require manual approval/moderation of entries
    - Improved session handling (no more separate verification file!)
    - Option to run as stand-alone script, or through another page
    - Secure data file storage method already implemented
    - Now supports basic smilies
    - Can disable image verification if not supported
    - New option to protect email addresses
    - And more - read below
  • 05-17-06 - Not a version update, but I added instructions on making the guestbook even more secure.
  • 05-03-06 Version 1.31 - Fixed a bug when editing entries - Name, website, and email fields can now be modified on existing entries.
  • 03-16-06 Version 1.3 - Revised layout a tiny bit - Now checks for GD support and gives error if missing - Adds http:// prefix if not entered in web address - IP addresses of posters shown in admin box - Can now ban posters by IP (removes all of their posts too) - Added confirmation before deleting and banning
  • 02-16-06 Version 1.2 - Added option to allow or disallow html in posts - Fixed a magic quotes bug
  • 02-06-06 Version 1.1 - Added option to prevent search engine robots from following links posted by visitors (using the nofollow tag)
  • 02-02-06 Version 1.0 - First public release!

Some of the features

  • Flat-file storage with precautions in place to prevent data files from being viewed.
  • Various security measures to prevent abuse.
  • Separate config and language files.
  • Image verification support (can be disabled if your server does not support the GD library).
  • Administrative interface to edit and delete entries, ban IPs (and automatically remove entries from that IP), and an option to enable manual approval of entries.
  • Implements ‘nofol’ tag to prevent search engine spiders from following links in entries (discourages some spammers).
  • HTML in posts disabled by default - you can enable this if you like, but it is a big risk.
  • Option to run as stand-alone script or included through another page.
  • Smilies are supported (either enter in the code, or click to add!)

Notes

If you want to include this script inside another page, be sure to set the proper ’stand alone’ setting in the config file. You may also need to include the session_start function at the very top of the PHP file you are including the script from:

<?php session_start(); ?>

Then just include the script in your file like this:

<?php include 'ddgb.php'; ?>

Overview of the options

These options can be set in config.php file

Path to ddgb.php

This needs to be set to the full url of the ddgb.php file on your server. Example: http://www.yoursite.com/ddgb/ddgb.php

Path to ddgb-verify.php

This needs to be set to the full url of the ddgb-verify.php file on your server. Example: http://www.yoursite.com/ddgb/ddgb-verify.php

Locale Setting

This allows you to choose the language file the script will use. The current version includes English and Formal German. You can also create your own by using one of the existing files as a template. Just set this option to the name of the file (without the .php) that you want to use.

Administrator Password

This is the password used to perform the administrative functions - editing, deleting, banning, and moderating. Be sure to change the default password.

Run as Stand-Alone Script

If you plan to run this script by itself, leave this option set to TRUE. If you want to include it in another page, set it to FALSE, and take a look at the information above under the ‘Notes’ section.

Title Tag

This is the title of the page when the script is used in stand-alone mode.

Path to Data File

This is the location of the data file used to store entries. Be sure to give it write-access (chmod 666 or 777).

Path to Ban File

This is the location of the data file used to store banned IPs. Be sure to give it write-access (chmod 666 or 777).

Requre Manually Entry Approval

If enabled, this will require that the admin manually approve posts. To do this, simply log in using the admin link and you will see all of the posts (including the ones not yet approved). Just click the appropriate link to approve them, or delete them instead if you wish.

Enable Smiles

If enabled, this option will convert text-smilies into images. It will also show the available smilies on the ‘new entry’ page.

Show Introduction Text

This is an optional intro which can be shown above the guestbook. The text it uses can be found in the language file you are using. This is disabled by default.

Disable Image Verification

If this script tells you that your server does not support image verification because you do not have access to the GD library, or you simply wish to disable image verification, set this to TRUE.

Image Verification Colors

This allows you to easily change the colors of the verification image. You can enter either 3 or 6 character hex color codes.

Path to CSS File

This is the location of the script’s CSS file, which controls the look of the guestbook.

Entries Per Page

Determines how many entries will be shown on each page. If there are more entries than this number, the guestbook will be split up into multiple pages.

Allow HTML in Messages

This option is dangerous because it allows visitors to enter HTML, which is a big security risk. It is disabled by default.

Protect Email Addresses

With this option enabled, email addresses will be shown in the following format instead of as traditional links: someone [at] somewhere [dot] net.

Enable File Locking

File locking is not supported by all servers. If you would like to use this feature, set this to TRUE.

Email Notification of Posts

For those of you who would like to receive email notification anytime someone adds a new entry, here is a simple mod. First, find this line in the main script file (ddgb.php):

echo '<p>' . _ADDED_THX . '</p>';

Right after it, add the following:

mail('user@domain.com', 'New Guestbook Entry', 'A New Guestbook Entry was added!');

Be sure to set your email address. The second parameter is the subject, and the third parameter is the message.

You can also use the following variables for your email’s subject or message: $fm_name $fm_website $fm_email $fm_location $fm_message. For example:

mail('user@domain.com', 'New Guestbook Entry', 'A New Guestbook Entry was added by' . $fm_name);

If this method does not work for you, it may have to do with the way your server is configured. Some hosts require that you manually configure the sendmail parameters for the PHP mail function to work properly. If you think this might be the case, you can try the following code instead:

$to = "user@domain.com";
$from = "user@domain.com";
$subject = "New Guestbook Entry";
$body = "A new guestbook entry has been added to your site.";
ini_set("SMTP","localhost");
ini_set("sendmail_from",$from);
$result = mail($to, $subject, $body, "From: $from");

Changing the timezone

If you would like to change the timezone setting for the script, edit config.php and find the following line:

// *** START OF OPTIONS ***

After it, add the following:

date_default_timezone_set('TIMEZONE');

Where TIMEZONE is a valid timezone identifier.

Pages: « 36 35 [34] 33 32 31 30 29 28 27 261 » Show All

  1. Ok Dagon. As I am going thru my guestbook manually Banning IPs one by one, I find myself very frustrated that this program cannot just show a list of every comment with a checkbox beside it and a master option to ban/delete all checked IPs / posts.

    another problem I REALLY need your help on. I consistently lose posts when I try to add posts from another Guestbook. I even got the recommended timestamp and everything, and when I view the file on my server, all of the posts are there, they just will not appear in the Guestbook.

    PLEASE Email me with help.

  2. 509
    Henrik

    Hello

    I want to have the comment-page and the entry-page in the same window! Is this posible?

    THX
    Henrik

  3. l’m looking for a guest book which text and pictures can be posted and all entries appear on the page in order for folk to contribute easily to a web page/s.
    It should preferably be free and open for anyone without too much fuss to enter the information and 580 pixels wide with picture resize to fit if too large.

  4. guestbook at http://www.asshetonbowmen.com/ddgb/ddgb.php

    Problem with verification image. The image code does not update and I get the same code every time. A14FE

    Help please!!

  5. 506
    dean

    Hi Admin,
    thank you for this great script, i tried on localhost and it work properly, but when I upload them (http://mysite.com/ddgb/ddgb.php), and I post an entry, submit, then some message came out like this :
    Warning: fopen(dat/.entries) [function.fopen]: failed to open stream: Permission denied in /home/suplem01/public_html/ddgb/ddgb.php on line 549

    Warning: fwrite(): supplied argument is not a valid stream resource in /home/suplem01/public_html/ddgb/ddgb.php on line 570

    Warning: fwrite(): supplied argument is not a valid stream resource in /home/suplem01/public_html/ddgb/ddgb.php on line 574

    Entry added. Thank You!

    Return to guestbook

    Warning: fclose(): supplied argument is not a valid stream resource in /home/suplem01/public_html/ddgb/ddgb.php on line 587

    Frankly I’m newbie, Can you help me ? Thanks.

  6. can i add a form were users can upload an image or photo with the entry ???

    HELP ME!

  7. 504
    paal

    Hi, I now use ddgb on my php nuke website and is installed as a module. Had to change all basename in ddgb.php, example:
    From:
    echo ‘«’ . _PREVIOUS . ‘   ’;

    To:
    echo ‘«’ . _PREVIOUS . ‘   ’;

    I also insterted a variable @nuke_module in the config.php

    Is it possible in future versions to insert such changes?
    I can mail the changes I have made if you wish.

    Best regards paal

  8. Hi, figured it out, 24H GMT time result, easy really:

    Edit locale language file to this for HH:MM:SS GMT date display.

    DEFINE('_FORMAT_DATE','j M Y, H:i:s ');
    DEFINE('_WRITTEN_ON_TIME','GMT');

    Thanks, will PP to you soon!
    Nev.

  9. 502
    Nev

    Hi, great script, is it possible to have the date result in 24HR time format instead of am/pm?

    Thank you!
    Nev.

  10. 501
    Conny Magnusson

    Hi,
    I wonder if it´s possible to get the Image-veryfication script as a standalone.

    And I wonder if it´s possible to make this perfekt Guestbook to work with MySql datebase.

    // Conny in Sweden

  11. Brilliant script - I had some SPAM problems. Implimenting image verification lessen the SPAM be far, but still had one or 2 spammers. This will sort me out.
    Thanx a mil.

  12. Nevermind. Found out on another site that I had to use a fulll path, including public_html etc in it. Something to consider adding to the installation file or something? A n00b like me doesn’t know that that stuff should be added aswell. When reading “path” I assume I have to fill in the subfolders etc. Not the public_html stuff with it.

    Still, the files .banlist and .entries aren’t in the zip, and yes I have “show all hidden files” on … They appear when adding an entry, so that problem is easily fixed. however not every person knows how to find that out.

    Further, great script! I’m glad I got it working since yours is the best that I found so far.

    Love,
    Mirna

  13. And yes, i DID chmod the .banlist and .entries files after they appeared. Forgot to include it into my last post.

    Love,
    Mirna

  14. I’m testing this script but I can’t get it to work to load into another site.

    I keep getting this error:

    Warning: file_get_contents() [function.file-get-contents]: Unable to access dat/.entries in /storage/mijndomein/users/035522/public/sites/www.dweilorkestheur-es.nl/gastenbuukske/ddgb.php on line 1049
    
    Warning: file_get_contents(dat/.entries) [function.file-get-contents]: failed to open stream: Onbekend bestand of map in /storage/mijndomein/users/035522/public/sites/www.dweilorkestheur-es.nl/gastenbuukske/ddgb.php on line 1049

    Also the zip file doesn’t contain any .entries and .banlist
    files. I had to post a message, to get those files appear on my FTP program.

    The script runs fine when accessing the proper url, but not when using the include. Also the guestbook contains two messages, but none show up when using it with an include.

    If anyone knows a similar script that DOES work, please let me know. I need something simple, without MYSQL and options to include it within an excisting layout. Prefered with spam filter or such.

    Thanks,
    Love,
    Mirna

  15. Hi admin,
    I use your g.book for a while now and it’s a great script. Thanks! But is it possible to get the verification code work in explorer 6?
    I tried to use the demo at yours too, with ie6 but i wasnt able to view the characters also. Is there somehow a hack for it so it work properly in da good old shit ie6? Hope so.
    Thanks

    Dave

Pages: « 36 35 [34] 33 32 31 30 29 28 27 261 » Show All

Leave a Comment

Before you comment: If you are having an issue with a script, please make sure you have read the entire article. Also, please read through the comments because most common issues have already been discussed many times. Thanks.


Be sure to wrap all code in <code></code> tags.