CGI Scripting

Using the Guestbook script
BASICS

EarthLink's Guestbook script is used to gather data from a form and then append it on a HTML file on your Web site. This script is suited for those that don't want the data in the form of E-mail but displayed on their Web site.

The Form Page

  1. To start using the Guestbook, you will need a form for visitors to enter their information. You can either create your own form or use the sample "Sign In" page, provided below. For new users, it is highly recommended to start with the sample page. Forms can be created using most Web authoring programs. If you don't know how to create forms, refer to the following URLs to learn how.

    HTMLGoodies Forms Tutorial
    Webcom's Forms Tutorial
    HTML Forms Tutorial by NCSA

  2. Once you've created your form, you will need to set the METHOD of the form to POST and the ACTION of the form to http://home.earthlink.net/cgi-bin/guestbook.cgi.
    Here is an example of the tag:
  3. <form method="post" action="http://home.earthlink.net/cgi-bin/guestbook.cgi >

Below is a sample HTML file that uses the Guestbook script.



<-- Begin sample form -->


<html>


<head>

<title> Sign Guestbook </title>

</head>



<body bgcolor="black" text="white">


<center>

	<h2>Sign My Guestbook</h2>

</center>


<hr width="85%">


<form method="post" action="http://home.earthlink.net/cgi-bin/guestbook.cgi">


<table cellpadding="0" border="0" align="center">

<tr>

	<td width="25">

		<b> Name: </b>

	</td>

	<td rowspan="4" width="5"></td>

	<td>

		<input type="text" name="name" size="25" maxlength="25">

	</td>

</tr>

<tr>

	<td>

		<b> Email: </b>

	</td>

	<td>

		<input type="text" name="email" size="25" maxlength="25">

	</td>

</tr>

<tr>

	<td>

		<b> Location: </b>

	</td>

	<td>

		<input type="text" name="location" size="25" maxlength="25">

	</td>

</tr>

<tr>

	<td>

		<b> Homepage: </b>

	</td>

	<td>

		<input type="text" name="url" value="http://" size="40" maxlength="50">

	</td>

</tr>


<tr></tr>

<tr>

	<td>

		<b> Comments: </b>

	</td>

</tr>

<tr>

	<td colspan="4">

		<textarea name="comments" rows="10" cols="50"></textarea>

	</td>

</tr>


<tr></tr>

<tr>

	<td colspan="4" align="center">

		<input type="submit" value="Sign"> <input type="reset" value="Clear">

	</td>

</tr>

</table>


</form>


<hr width="85%">


</body>

</html>

Feel free to copy and paste the above example into your favorite text editor. Then Save As guestbook.html or download the page from our site by right clicking on this link. Then clicking on Save As.

Modifying the "Sign In" Page

You can easily change the color of the form by editing the BGCOLOR and TEXT parameters in the BODY tag. You can go here to see a listing of the available colors:

ORA Color Name Samples

You can increase or decrease the size of the text fields by editing the SIZE parameter just raise or lower the number to suit your needs.

All fields are optional. If you don't want to have a particular text field displayed, remove the appropriate table row. This is the part enclosed in the <tr> and <\tr>. Don't forget to remove the tags as well.

Viewing the Guestbook

To view your Guestbook, type in the following URL in your browser.

http://home.earthlink.net/cgi-bin/guestbook.cgi

You can also link to your Guestbook by using the anchor tag. Here is the sample HTML to do so:

<a href="http://home.earthlink.net/cgi-bin/guestbook.cgi">
View My Guestbook</a>
Editing and Removing Entries

You can edit and delete entries from your Guestbook by going to the Guestbook Manager

Other Related Pages

Forms Menu



StarterSite Web Support Main Menu