I have been playing with a guestbook CGI script that saves the guestbook form as JavaScript Function Calls gbF() in a file called gbookFXXX.js

Include the guestbook data in you web page and use JavaScript to process the data.

Once downloaded you can sort, select and format.

You have the data to validate the next guestbook entry.

You can turn a static web page into a dynamic web page.

Great for simple applications like sports club results pages, events diaries, booking systems.

I have written up my ideas at:


Some code:

store the following into gbookFXXXX.js

"doug", "d@g", "28/10/02 07:53:02", "",

"doug", "doug@somewhere", "Wed, 30 Oct 2002 08:45:28 UTC+0100", "",
"This is a test"

included into a Web Page:


function gbF( name,email,postedOn,IPaddress,userfield1,userfield2,userfield3,userfield4,comments){

"<TD >"+ name+ "</TD><TD >"+ email+"</TD><TD >"+ postedOn+"</TD>"+
"<TD >"+ IPaddress+ "</TD>"+
"<TD >"+ userfield1+"</TD><TD >"+ userfield2+ "</TD>"+
"<TD >"+ userfield3+"</TD><TD >"+ userfield4+ "</TD>"+
"<TD >"+ comments+ "</TD>"+


<h4> One line of the table </h4>

<table border=2 >

<script language="JavaScript" >

"name","email","postedOn", "",
"userfield1", "userfield2", "userfield3", "userfield4",


<h4> Now include the data from the guestbook </h4>

<table border=2 >
<!-- local guestbook in same place as guestbook.asp -->
<script language = "JavaScript" type = "text/javascript"
src = "./gbookFXXX.js" >


<!-- remote guestbook-->
<script language = "JavaScript" type = "text/javascript"
src = "http://www.dougrice.webhoster.co.uk/public/gbookFXXX.js" >



My web site has a perl, asp and a trial PHP guestbook script.

I started by modifing Matt Wright's perl guestbook script:

$N = $FORMJS{'guestbook'};

open (GUESTFJS,">>$guestbookjsf$N.js") || &file_error( GUESTJS, "$guestbookjsf$N.js" );
print GUESTFJS "gbF( \n";
print GUESTFJS "\"$FORMJS{'name'}\",";
print GUESTFJS "\"$FORMJS{'email'}\",";
print GUESTFJS "\"$date\",";
print GUESTFJS "\"$ENV{'REMOTE_ADDR'}\",\n";
print GUESTFJS "\"$FORMJS{'userfield1'}\",\n";
print GUESTFJS "\"$FORMJS{'userfield2'}\",\n";
print GUESTFJS "\"$FORMJS{'userfield3'}\",\n";
print GUESTFJS "\"$FORMJS{'userfield4'}\",\n";
print GUESTFJS "\"$FORMJS{'comments'}\"\n";
print GUESTFJS ");\n";
close (GUESTFJS);

if ( $FORMJS{'loadnextpage'} ){

# Print Out Initial Output Location Heading
print "Location: $FORMJS{'nextpage'}\n\n";

There are live demos of some of the possibilties.


You use a stable server side cgi script, and develop your web pages on your client machine, off line.

JavaScript's sort fuctions is very powerful.

Great for applications that just need a sorted list.

You get an audit trail of all submits.

Makes JavaScript really powerful.

The data can be included in lots of different pages.

Saves a lot of learning ( and stress ) about server side coding.

Quick for rapid prototyping.

I place this idea into the public domain for any ISP to provide like BTOpenworld.

I want BTOpenWolrd to add it to their CGI scripts. See their guestbook help page at:


Happy Scripting,

Dougy Rice