Jump to content
sawild

Guestbook Help!

Recommended Posts

Hi all! I'm attempting to put a guestbook on my website. I've been following the script from "http://articles.techrepublic.com.com/5100-22_11-5076796.html".However, I'm obviously doing something wrong as once I hit submit, it goes to the file in the cgi-bin and doesn't go any further. I'm left with a blank screen. Please help! It's driving me crazy!

<form method="post" action="/cgi-bin/guestbook.cgi">					<p class="tags">Name: <input type="text" name="name" id="name" size="30" /></p>					<p class="tags">E-mail address: <input type="text" name="email" id="email" size="30" /></p>					<p class="tags">Website: <input type="text" name="website" id="website" /></p>					<p class="tags">Comment: <textarea name="comment" id="comment" rows=3 cols=45 wrap=virtual></textarea></p>					<br />					<input type="submit" name="submit" value="POST to the guestbook">					<input type="reset" name="reset" value="CLEAR the form" />				</form>								<!--add-->			

#!/usr/bin/perl#variables that will be used later.$guestbookreal = "guest.html";$return = "http://www.damienbt.com/guest.html";read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});@pairs = split(/&/, $buffer);foreach $pair(@pairs) {   ($name, $value) = split(/=/, $pair);   $value =~ tr/+/ /;   $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;   $value =~ s/<\!\-\-.*\-\->//g; # get rid of SSI   $in{$name} = $value;   }open (FILE,"$guestbookreal");   @LINES=<FILE>;   chop (@LINES);   close(FILE);   $SIZE=@LINES;open (GUEST,">$guestbookreal");for ($i=0;$i<=$SIZE;$i++) {   $_=$LINES[$i];   print GUEST "$_\n";   if (/<!--add-->/) {      if ($in{'email'} ne '') {         print GUEST "<b><a href=\"mailto:$in{'email'}\">";         print GUEST "$in{'name'}</a></b>:<br>\n";         } else {         print GUEST "<b>$in{'name'}</b>:<br>\n";         }      if ($in{'website'} ne '') {         print GUEST "<a href=\"$in{'website'}\">";         }      print GUEST "$in{'comment'}<p>\n";      }   }close (GUEST);print "Location: $return\n\n";

Share this post


Link to post
Share on other sites

I'm not sure I get this: " it goes to the file in the cgi-bin and doesn't go any further."

Share this post


Link to post
Share on other sites

I got"Not FoundThe requested URL /cgi-bin/guestbook.cgi was not found on this server.Apache/2.2.3 (CentOS) Server at damienbt.com Port 80"I dont think the guestbook is on the server?Maybe try putting the CGI in the same folder as the html?

Share this post


Link to post
Share on other sites
I got"Not FoundThe requested URL /cgi-bin/guestbook.cgi was not found on this server.Apache/2.2.3 (CentOS) Server at damienbt.com Port 80"I dont think the guestbook is on the server?Maybe try putting the CGI in the same folder as the html?
Why in the world are you responding to 3-month-old posts? Edited by Deirdre's Dad

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×