PHP Classes

File: guestbook_example.php

Recommend this page to a friend!
  Classes of Tom Taylor   Guestbook v1   guestbook_example.php   Download  
File: guestbook_example.php
Role: Example script
Content type: text/plain
Description: example of the guestbook class in use
Class: Guestbook v1
Post and display comments in a guestbook
Author: By
Last change:
Date: 16 years ago
Size: 2,881 bytes


Class file image Download
$guestbook = new Guestbook(); // create a new instance of the guestbook
$guestbook->GuestbookPage = ''; // the location of the guestbook page on ur site.
$guestbook->EmailsFrom = ''; // where do the emails come from inrelation to the guestbook
$guestbook->ConfirmMessage = 0; // set this to 1 if you want to email whoever submits the form letting them know to that it has been submitted.
$guestbook->SubmitConfirmationEmail = 'This is the message which is sent to people if you set ConfirmMessage'; // the message which is sent to the person who submitted the form
$guestbook->myEmail = ''; // set the email you want the guestbook entrys going to;


$_POST['addToGuestbook'])) {
$guestbook->CheckForm($_POST) == true) {
$guestbook->FormError = 'Guestbook submission sucessfull.';
    } else {
$guestbook->FormError)) {
$guestbook->FormError = 'Please ensure "Name", "Title" and "Message" fields are filled in.';

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Guestbook Example</title>



->TableWidth = 690; // set the width of the guestbook table
$guestbook->TableBorder = 0; // set the border of the table
$guestbook->NameAlign = 'right'; // does the author of each log, align left, right or middle ?
$guestbook->TableId = 'guestView'; // the id for the table
$guestbook->TdClass = 'rows'; // the class for the td's in the table .. padding, bg color..etc
$guestbook->DivTitleClass = 'guestTitle'; // the div class name for the title section
$guestbook->DivTimeClass = 'guestTime'; // the div class name for the time section
$guestbook->DivAuthorClass = 'guestAuthor'; // the div class name for the author section
$guestbook->Add_TextInputSize = '30'; // size for the input text fields in the add form
$guestbook->Add_TextareaSize = '550px'; // width for the text area, eg: 24em, 1em, 100%, 50%, 10px, 100px . . .
$guestbook->Add_TextareaHeight = '100px;'; // height for the textarea, eg: 24em, 1em, 100%, 50%, 10px, 100px . . .
$guestbook->MessageLimit = 500;

$guestbook->JavascriptShowHide(); // make sure to include the javascript for the show / hide of the 'add to guestbook' link
$guestbook->showEntrys(); // draw the page elements