Guestbook Version 2.0

CGI program guestbk
An UNIX CGI guestbook with multiple user support and user define appearance.

Files:
  • reqired : qcgi.h & qcgi.cc
  • guestbk.h: The main program of guestbook
  • guestbk.html: A sample template of guestbook
  • guestbk.dat: A sample data file of guestbook
  • signbook.html: A sample sign in page

    Default Parameters:

  • read
    This field use the indicate the program to add an entry or to display the datafile.
    -1 : add an entry, 0 : display all entries, any # > 0 : display the last # entries.

  • required
    This field is only used when adding an entry.
    It specified the field(s) vistors must sign in. Please use "," to
    sperate each name of the required fields. (e.g. "name,email,homepage")
    note: no space between words.

  • datfile
    The name of your datafile.
    Please refer to datafile section for more details

  • html
    The name of your template file.
    Please refer to the tempate section for more details

  • redirect
    This field is only used when adding an entry.
    It will redirect the page to your specified URL instead of displaying the
    standard thankyou screen.

  • Users can add other parameters which will be use as data input if the
    name of the parameters are specified in data file.

    Template File:

  • The template file is everything you want to display when reading the
    guestbook except the data. You can add a line <!data> in the file to
    indicate where the program should insert the data. Please see the sample
    template file : guestbk.html

    Data File:

  • This is the file contant all your data and the data format.
    Each data is seperated by a <!data> line. Anything before
    the first <!data> line will treated as the data structure.
    Users can use put a $ sign in front of the field name to indicate
    it's input from a HTML form instead of static text. (e.g. "$email" or "$name")
    If the vistor forgot to enter that entry, it will appeared as {none}.
    Please see the the sample data file : guestbk.dat It is a empty
    database with just a data structure. You can edit it to suit your name. But
    don't forget to put the <!data> line at the end.
  • Note: Please don't change the data structure or modify the data file
    once everything is set up, it may corrupted the data.

    History:

  • version 1.0: It is my first CGI program, so it's very crappy. Data structure and appearance are fixed.
  • version 1.1: Added redirect and required parameter, first program to use with QCGI.
  • version 2.0: Added multiple user support and custom data structure and appearance.

    After you download the code, you should be able to compile it without any problems using any gcc or gcc++ compile. You need to download qcgi as well. You should link link the object file to qcgi after compiling. Since this software is free, so I'm not responsible for anything that may cause by using this program, use at your own risk.

    If you have any question about the code, please drop me a mail at yhchan@novice.uwaterloo.ca Please give some comments and suggestions if you are using the code. So that I can do better in the up coming version 3.0


    main-------------------

    Never say die - La Salle Spirit