GuestBook
 

(c) [werk01]

Overview

This extension installs a new object in a new tab of the object palette. It contains (and hides) PHP code for a simple PHP guestbook where each entry is successively listed in place of this object.

It provides consistency checks, HTML formatting, time stamping and entry alignment.

Step-by-Step
"Placeholders"

Demo and its Form

Support

Status

 

Starting with V2, GuestBook can be ordered for 12 Euro online.

History

V3.0:

  • blacklist to block spammers

V2.0:

  • better form support
  • code optimization
  • user interface improvements

V1.0:

  • first release

Detail

In 'passive' mode the object simply outputs the content of the guestbook file.

When a form calls this object, it runs in 'active' mode and checks the integrity of the values submitted by the form. You can specify fixed values for some fields or give a symbolic placeholder which is replaced by the value of the field.

'Filename' specifies the filename under which the guestbook entries are saved into and loaded from. Although this is a html file there must be no html or body tags in this file!

'Submitbutton' is the name of the submit of the originating page.

For consistency checks, you can enter a comma-separated list of field names to check. If any field is left blank, only the 'Error Message' is displayed.

If you have a special email form field you can name it.

For further processing you can setup a timestamp value, where the given format string must contain variables for the current values:

  • d = day of month (01 ... 31)
  • D = day of week (Fri ...)
  • m = month (01 ... 12)
  • M = month (Jan ...)
  • y = year (99)
  • Y = year (1999)
  • h = hour (01 ... 12)
  • H = hour (00 ... 23)
  • i = minutes (00 ... 59)
  • s = seconds (00 ... 59)

(There are several other characters, look at the PHP 'date' function)

The format fields accept html strings only. They are used to format the entry saved into the guestbook and are filled with the form content on the fly: enter your html code and enclose the form field names in curly brackets (for the form field 'street' add {street} into your format string).

There are two special fields: {timestamp} is the current timestamp you have set up previously. If the form contains a valid email address the 'eMail Format' string is used - - otherwise the simple 'Format' string is used.

In case the check of the provided fields fails the html formatted error string will be shown and no processing is performed.

Requirements

The form must send its data with the POST method, multipart/form-data is recommended as the transfer type.

Take care that the object performs on pages of type PHP only!

Create an totally empty guestbook file first- with no html or body tag at all!

The guestbook file must be writeable by PHP (look at the file permissions).