Thanks Jack. I sent it to both Urb and Brent last night, but never heard
back from them. Or from my ISP. It's lonely out here.
I'm sending both scripts, but imagine you just need the add script. These
go on an NT server.
Suz
>
>If you haven't solved this program yet, send me a copy of the Perl script
>and I'll take a look at it.
>> Isn't there someway I can modify this guestbook form action so that when
>> the user's comments are posted to the Web site guestbook, a copy will also
>> be e-mailed to me? I'd like to be able to monitor the submissions to make
>> sure nothing too offensive is added.
# These first three list MUST be at the TOP
# of all your cgi scripts
require "cgi_lib.pl";
$domainname = "endlessriveradventures.com";
InitCGI($domainname);
############################
########################################
$guestbook = "guestbook.txt";
&PrintHeader;
print "\n\n\n\n";
print "<html><head><title>Guestbook</title></head>\n";
print "<body bgcolor=\"#FFFFFF\">\n";
print "<center><font face="verdana, arial, helvetica" size=3
color="#000000"><B>Guestbook</B></font><hr></center>\n";
if (&ReadParse(*input))
{
if ($input{'Name'} eq "" )
{
$errorMessage = "The Name is a required field.";
&ShowError;
}
print "<br><br><font size=+2><i>Thank you for filling out our
Guestbook form.</i></font></h1><br>";
#write this info to a file
open(FILE, ">>$guestbook");
if (&lockfile(FILE))
{
seek(FILE,0,2);
print FILE "<hr>Name: <b>$input{'Name'}</b><br>\n";
print FILE "Email Address: <a
href=\"mailto:$input{'Email'}\">$input{'Email'}</a><br>\n";
print FILE "Home Page: <a
href=\"$input{'Homepage'}\">$input{'Homepage'}</a><br>\n";
print FILE "City: <b>$input{'City'}</b><br>\n";
print FILE "How they got here: <b>$input{'theWay'}</b><br>\n";
print FILE "Comments: <b>$input{'Comments'}</b><br>\n";
local ($month,$day,$year,$hour,$min,$am)=&thetime();
print FILE "Date: <b>$month $day, $year. $hour:$min
$am</b><br>\n";
&unlockfile(FILE);
}
close(FILE);
#write this info to the screen
print "<b>Here is the information you submitted</b><br>\n";
print "Name: <b>$input{'Name'}</b><br>\n";
print "Email Address: <a
href=\"mailto:$input{'Email'}\">$input{'Email'}</a><br>\n";
print "Home Page: <a
href=\"$input{'Homepage'}\">$input{'Homepage'}</a><br>\n";
print "City: <b>$input{'City'}</b><br>\n";
print "How they got here: <b>$input{'theWay'}</b><br>\n";
print "Comments: <b>$input{'Comments'}</b><br>\n";
local ($month,$day,$year,$hour,$min,$am)=&thetime();
print "Date: <b>$month $day, $year. $hour:$min $am</b><br>\n";
print "<hr width=50% align=center>\n";
print "</body></html>\n";
}
else
{
print &PrintHeader,'<form><input type="submit">Data: <input
name="myfield">';
}
sub ShowError
{
print "<br><br><h2><i>Guestbook Form Error</i></h2><br>";
print "We are unable to process your information due to the
following:";
print "<br><br>";
print "<h2>$errorMessage</h2>\n";
print "<center>";
print "Please fill out the form properly.";
print "</body></html>";
exit;
}
exit;
# These first three list MUST be at the TOP
# of all your cgi scripts
require "cgi_lib.pl";
$domainname = "endlessriveradventures.com";
InitCGI($domainname);
############################
########################################
$gbook = "guestbook.txt";
&PrintHeader;
print "\n\n\n";
print "<html><head><title>Guest Book</title></head>\n";
print "<body bgcolor=\"#FFFFFF\">\n";
print "<center><font size=+5>Guest Book</font><hr></center>\n";
#read this file
if(open(FILE, "$gbook"))
{
$line = ".";
while ($line ne "")
{
$line = <FILE>;
print $line;
}
close(FILE);
}
else
{
print "Can't open file\n";
}
print "\n\n";
print "<hr width=50% align=center>\n";
print "</body></html>\n";
exit;
sub ShowError
{
print "<br><br><h2><i>Guestbook Form Error</i></h2><br>";
print "We are unable to process your information due to the
following:";
print "<br><br>";
print "<h2>$errorMessage</h2>\n";
print "<center>";
print "Please fill out the form properly.";
print "</body></html>";
exit;
}
exit;
Suzanne Stephens, Dave Stephens Design; Ashland, Oregon
541-552-1190, 541-1192 http://www.KickassDesign.com/
CyberCircus Grand Prize Winners http://www.thecybercircus.com/
Web Page Design for Designers: http://www.wpdfd.com/wpdres.htm
Clip Art: http://www.freeimages.com/artists/
Tender Loving Care Interactive DVD movie: http://tenderlovingcare.cc/