General discussion
Thread display: Collapse - |
All Comments
Start or search
Create a new discussion
If you're asking for technical help, please be sure to include all your system info, including operating system, model number, and any other specifics related to the problem. Also please exercise your best judgment when posting in the forums--revealing personal information such as your e-mail address, telephone number, and address is not recommended.
help with CGI script
http://builder.com.com/5100-31-5076796.html?tag=search
When I use this script, no data is returned to me from the guestbook form this is completed. I have
included the coding below for the file - guestbook.cgi & also 2 URL's that you can review. Please troubleshoot for me & let me know that I need to do in order for this to function properly.
Please review the source code on the following web pages.
http:\\www.nextgeneration-ministries.com\guestbook.html
http:\\www.nextgeneration-ministries.com\guestbookinfo.html
___________________________________________
guestbook.cgi -
#!/usr/bin/perl
#variables that will be used later.
$guestbookreal = "/guestbook.html";
$return = "http://www.nextgeneration-ministries.com/guestbookinfo.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{'www'} ne '') {
print GUEST "<a href=\"$in{'url'}\">";
print GUEST "$in{'www'}</a><br>\n";
}
print GUEST "$in{'body'}<p>\n";
}
}
close (GUEST);
print "Location: $return\n\n";
__________________________________________
Thank you,
Kirk