SEARCH
Join Xtra Xtra Mail My Account Xtra Members Xtra Products Home
HOME  
QUICKSTART PLUS  
QUICKSTART  
ACCESS  
EMAIL  
DOMAIN NAMES  
WEB SITES  
WEB HOSTING  
Web Hosting Home
 
XtraHost
XtraHost Home
Pricing
Subscribe
Cancel
Online Documentation
Site Administration
Hosted Sites
 
SiteStarter
 
ADVERTISING  
XTRA DEALERS  
PRICING  
TERMS

Home Web Hosting XtraHost CGI Help

CGI Script Instructions


Form Mailer instructions
Counter instructions
Guestbook instructions

3. Guestbook

A Guestbook allows visitors to your site to leave their comments and other details on your web site for others to view. Like the Form Mail it is set up to run with minimal modification - there are four simple steps to follow in order to add a Guestbook to your Xtrahost web site.

Please note that you can only have one Guestbook per Xtrahost site.

Step One Create an HTML page to contain the guestbook entries (the guest.html file)
HTML tag <META HTTP-EQUIV=Expires CONTENT="Tue, 04 Dec 1993 21:20:02">
Description The page must not be cacheable, as it will be redirected to after a guestbook entry has been submitted. Therefore your HTML page must contain a tag similar to the one above.

Please note that the above tag is case sensitive.

HTML Tag <!--Insert new entries here-->
Description This is a mandatory tag that is required for the guestbook to function.

This is the point at which new entries will be added to your guestbook. You can control whether entries are added before or after this tag: if they are added before it, the entries in the guestbook will be listed with the most recent first. If added after it, the entries in the guestbook will be listed as most recent last.

Example Guestbook HTML <HTML><HEAD><TITLE>Guestbook</TITLE></HEAD>

<META HTTP-EQUIV=Expires CONTENT="Tue, 04 Dec 1993 21:20:02">

<BODY>
Welcome to our Guestbook. Please leave an entry.
<BR>
<!--Insert new entries here-->
<BR>
Thanks for reading our guestbook.
</BODY>
</HTML>

Step Two Create a form to add entries to the Guestbook (the add.html form)
HTML tag <INPUT type=submit name="action" value="Submit">
Description The submit button is a mandatory field in this form, which must be named "action" and have value "Submit".

Your guestbook CANNOT have a field named "Date" as this will be filled in by the guestbook CGI.

There is a special field that may be mandatory depending on your Guestbook configuration. This is "emailAddress". See Step Three for when it is mandatory.

Example
<HTML><HEAD><TITLE>Add Guest</TITLE></HEAD>
<BODY><CENTER>
Please add an entry to our Guestbook

<FORM action="/cgi-bin/guestbook.cgi" method=POST>

Email Address:
<INPUT type=text size=40 name="emailAddress"><BR>
<BR>
Comment:
<INPUT type=text size=100 name="comment"><BR>
<BR>
<input type=submit name=action value=Submit>
</CENTER>
</FORM>
</BODY>
</HTML>

Step Three Configure the Guestbook
Address http://home.xtra.co.nz/admin/gbadmin
Description The Guestbook configuration program can be reached via the Administration Menu. Log in to the Admin utility at the above URL and set up your guestbook.

You must fill in the following fields otherwise your Guestbook won't work:

Field Guestbook Template
Description This is simply a piece of HTML that the guestbook will insert into the Guestbook HTML for you.

Before the template is inserted into the Guestbook HTML, entries of the form <guest_*> will be replaced by the fields in the add.html form: eg. <guest_address> would be replaced by the contents of the address field in the add form.
In addition, <guest_date> will be replaced by the current date and time.

Note that not all of the fields in the form need to be in the template.

HTML Example
<HR><B>
Email Address: <guest_emailAddress></B><BR>
Submission Date: <guest_date><BR><guest_comment>

In this example the submitted email address, the date and time of the submission, and the comment are added to the Guestbook.

Field Guestbook Filename
Description This is the file name of the HTML page you constructed in Step One, as referenced from the root directory of your web site.

This is another mandatory field.

Field Required Fields
Description The guestbook will check that users have entered something in each of the fields in your add form.

Note that if you want to make "emailAddress" mandatory (in the sense that the user has to put something that looks like an email address in it when they submit the form) it must also be a required field.

Field Administrative Email
Description This is the email address to which each guestbook submission will be emailed.

All the fields will be sent, not just the fields in the template, thereby allowing you to use private fields in the add form (ie. Fields that only the Guestbook visitor, and the recipient of the administrative email are able to see).

Note that these fields should not contain confidential data (eg. Credit card numbers) as neither the client connection to the web server, nor the email sent are encrypted.

This field may be empty, in which case no email will be sent on guestbook submission.

Field Insert new entries
Description This controls where new guestbook entries are inserted into the guestbook HTML. At the top, new entries will be inserted above previous entries; at the bottom they will be inserted below all previous entries.

Warning: do not change this setting when your guestbook has entries in it without also moving the entry tag to the appropriate point. Otherwise new entries will be inserted into the middle of the guestbook.

Field Guest Email
Description If this is set to YES, the guestbook will automatically send an email to the guestbook visitor.

Note: in this case, "emailAddress" is a mandatory (you must supply it) and required (users of your guestbook must supply it) field in your add form.

Field Guest Email Subject
Description This is the subject of the email to the Guestbook visitor: eg. "Thank You For Your Comments"
Field Guest Email Sender
Description This will be the email address from which the email appears to originate.

Note: You need to use an Xtra email address or a domain name address hosted with Xtra, as security reasons do not permit Xtra to allow its mail servers to operate as open relays. If non-Xtra hosted email addresses are used, the email will not be delivered.

Field Guest Email Contents
Description This is the body of the email that will be sent to the Guestbook visitor: eg. "Thank you for submitting an entry to our Guestbook. Please come back and visit our web site again soon".

Note that it must be in plain text.

Step Four Include a link to your Guestbook
  On the HTML page that you want your link to the Guestbook to appear, include the following tag:

<A HREF="form.html">Please Sign Our Guestbook</A>

form.html is the HTML file you created

If you wish to edit or remove the entries in your guestbook, you simply download the html file that contains your guestbook entries (called guest.html in the example) and use an editor to remove or change the appropriate entries. You then upload the file back to your site.

Click here for a printable version of this page


In order to maximise your Internet presence, registering your company name as a domain name is an important step. Xtra Business can help you register your domain and host it for you. Then you can tell the world who you are and where to reach you! [more]



You've got some questions that need answering - right? Xtra is here to help - first consult our comprehensive Frequently Asked Questions. Or ring the Business Help Desk on 0800 BUSINESS.



Did you know that Xtra delivers over 6 million opportunities every month for advertisers to engage their audience? Increasingly, the Internet is the place where people are going to be informed and to purchase. Make sure you make your presence felt. [more]



©2000 Telecom New Zealand Limited. All rights reserved. Terms and Conditions.