Can you send me the actuall perl file off list, and I'll run it on my linux server so I can debug it for you?
> > From: Stephen thomas <[EMAIL PROTECTED]> > Date: 2004/10/28 Thu AM 11:19:45 CDT > To: [EMAIL PROTECTED] > Subject: [wdvltalk] perl experts > > hi, > > I am using linux server, my guest book entries are not geting date stamped > on it . i am using following scripts guestbook.pl. can anyone help me to > solve this problem. > > stephen > > > #!/usr/bin/perl > ############################################################################ > ## > # Guestbook Version 2.3.1 # > # Copyright 1996 Matt Wright [EMAIL PROTECTED] # > # Created 4/21/95 Last Modified 10/29/95 # > # Scripts Archive at: http://www.worldwidemart.com/scripts/ # > ############################################################################ > ## > # COPYRIGHT NOTICE # > # Copyright 1996 Matthew M. Wright All Rights Reserved. # > # # > # Guestbook may be used and modified free of charge by anyone so long as # > # this copyright notice and the comments above remain intact. By using this > # > # code you agree to indemnify Matthew M. Wright from any liability that # > # might arise from it's use. # > # # > # Selling the code for this program without prior written consent is # > # expressly forbidden. In other words, please ask first before you try and # > # make money off of my program. # > # # > # Obtain permission before redistributing this software over the Internet or > # > # in any other medium. In all cases copyright and header must remain > intact.# > ############################################################################ > ## > # Set Variables > $guestbookurl = "http://xxx.com/guest/guestbook.html"; > $guestbookreal = "/home/sat/www/guest/guestbook.html"; > $guestlog = "/home/vgms/www/guest/guestlog.html"; > $cgiurl = "http://xxx.com/cgi-bin/guestbook.pl"; > $mailprog = '/usr/sbin/sendmail'; > $recipient = '[EMAIL PROTECTED]'; > $date_command = "/usr/bin/date"; > # Set Your Options: > $mail = 1; # 1 = Yes; 0 = No > $uselog = 1; # 1 = Yes; 0 = No > $linkmail = 1; # 1 = Yes; 0 = No > $separator = 1; # 1 = <hr>; 0 = <p> > $redirection = 0; # 1 = Yes; 0 = No > $entry_order = 1; # 1 = Newest entries added first; > # 0 = Newest Entries added last. > $remote_mail = 1; # 1 = Yes; 0 = No > $allow_html = 1; # 1 = Yes; 0 = No > $line_breaks = 0; # 1 = Yes; 0 = No > # If you answered 1 to $mail or $remote_mail you will need to fill out > # these variables below: > > # Done > ############################################################################ > ## > # Get the Date for Entry > $date = `$date_command +"%A, %B %d, %Y at %T (%Z)"`; chop($date); > $shortdate = `$date_command +"%D %T %Z"`; chop($shortdate); > # Get the input > read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); > # Split the name-value pairs > @pairs = split(/&/, $buffer); > foreach $pair (@pairs) { > ($name, $value) = split(/=/, $pair); > # Un-Webify plus signs and %-encoding > $value =~ tr/+/ /; > $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; > $value =~ s/<!--(.|\n)*-->//g; > if ($allow_html != 1) { > $value =~ s/<([^>]|\n)*>//g; > } > $FORM{$name} = $value; > } > # Print the Blank Response Subroutines > &no_comments unless $FORM{'comments'}; > &no_name unless $FORM{'realname'}; > # Begin the Editing of the Guestbook File > open (FILE,"$guestbookreal") || die "Can't Open $guestbookreal: $!\n"; > @LINES=<FILE>; > close(FILE); > [EMAIL PROTECTED]; > # Open Link File to Output > open (GUEST,">$guestbookreal") || die "Can't Open $guestbookreal: $!\n"; > for ($i=0;$i<=$SIZE;$i++) { > $_=$LINES[$i]; > if (/<!--begin-->/) { > if ($entry_order eq '1') { > print GUEST "<!--begin-->\n"; > print GUEST "<b>Name:</b>$FORM{'realname'}<br>\n"; > } > if ($FORM{'url'}) { > print GUEST "<b>URL:</b><a href=\"$FORM{'url'}\">$FORM{'url'}</a><br>\n"; > } > else { > print GUEST "$FORM{''}\n"; > } > if ( $FORM{'username'} ){ > if ($linkmail eq '1') { > print GUEST "<b>E-Mail:</b> \<<a href=\"mailto:$FORM{'username'}\">"; > print GUEST "$FORM{'username'}</a>\><br>\n"; > } > else { > print GUEST " <$FORM{''}>\n"; > } > } > print GUEST "<br>\n"; > if ( $FORM{'city'} ){ > print GUEST "<b>City:</b>$FORM{'city'}<br>\n"; > } > if ( $FORM{'state'} ){ > print GUEST "<b>State:</b> $FORM{'state'}<br>\n"; > } > if ( $FORM{'country'} ){ > print GUEST "<b>Country:</b> $FORM{'country'}<br>\n"; > } > if ($line_breaks == 1) { > $FORM{'comments'} =~ s/\cM\n/<br>\n/g; > } > print GUEST "<b>Comments:</b><blockquote>$FORM{'comments'}</blockquote>\n"; > if ($separator eq '1') { > print GUEST "<b>Date:</b> - $date<hr>\n\n"; > } > else { > print GUEST "<b>Date:</b> - $date<p>\n\n"; > } > if ($entry_order eq '0') { > print GUEST "<!--begin-->\n"; > } > } > else { > print GUEST $_; > } > } > close (GUEST); > # Log The Entry > if ($uselog eq '1') { > &log('entry'); > } > > ######### > # Options > # Mail Option > if ($mail eq '1') { > open (MAIL, "|$mailprog $recipient") || die "Can't open $mailprog!\n"; > print MAIL "Reply-to: $FORM{'username'} ($FORM{'realname'})\n"; > print MAIL "From: $FORM{'username'} ($FORM{'realname'})\n"; > print MAIL "Subject: Entry to Guestbook\n\n"; > print MAIL "You have a new entry in your guestbook:\n\n"; > print MAIL "------------------------------------------------------\n"; > print MAIL "$FORM{'comments'}\n"; > print MAIL "$FORM{'realname'}"; > if ( $FORM{'username'} ){ > print MAIL " <$FORM{'username'}>"; > } > print MAIL "\n"; > if ( $FORM{'city'} ){ > print MAIL "$FORM{'city'},"; > } > if ( $FORM{'state'} ){ > print MAIL " $FORM{'state'}"; > } > if ( $FORM{'country'} ){ > print MAIL " $FORM{'country'}"; > } > print MAIL " - $date\n"; > print MAIL "------------------------------------------------------\n"; > close (MAIL); > } > if ($remote_mail eq '1' && $FORM{'username'}) { > open (MAIL, "|$mailprog -t") || die "Can't open $mailprog!\n"; > print MAIL "To: $FORM{'username'}\n"; > print MAIL "From: $recipient\n"; > print MAIL "Subject: Entry to Guestbook\n\n"; > print MAIL "Thank you for signing my Guest Book \n"; > print MAIL "Mr.M.G.Sreekumar has sent you a greeting,click on the link to > view the greeting\n"; > print MAIL "http://xxx.com/greet.html \n"; > print MAIL "------------------------------------------------------\n"; > print MAIL "Here is what you have submitted:\n"; > print MAIL "Name:$FORM{'realname'}\n"; > if ( $FORM{'username'} ){ > print MAIL "E-Mail: <$FORM{'username'}>\n"; > } > print MAIL "\n"; > if ( $FORM{'city'} ){ > print MAIL "City:$FORM{'city'}\n"; > } > if ( $FORM{'state'} ){ > print MAIL "State: $FORM{'state'}\n"; > } > if ( $FORM{'country'} ){ > print MAIL "Country: $FORM{'country'}\n"; > } > print MAIL "Comments:$FORM{'comments'}\n"; > print MAIL "Date: - $date\n"; > print MAIL "------------------------------------------------------\n"; > close (MAIL); > } > # Print Out Initial Output Location Heading > if ($redirection eq '1') { > print "Location: $guestbookurl\n\n"; > } > else { > &no_redirection; > } > #######################Ebebd3 > # Subroutines > sub no_comments { > print "Content-type: text/html\n\n"; > print "<html><head><title>Data Entry Error</title></head>\n"; > # print "<body \"bgcolor=\"#Ebeb63\"text=\"#669999\"link=\"#FF9999\" > vlink=\"#FFFF33\" alink=\"#99FF66\">\n"; > print "<body \BGCOLOR=\"#EBEBD3\"text=\"#669999\"link=\"#FF9999\" > vlink=\"#FFFF33\" alink=\"#99FF66\">\n"; > print "<CENTER>You forgot to fill out comments, would you please type in the > required field to complete the guestbook entry.</CENTER>\n"; > print "<hr>\n"; > print "<form method=POST action=\"$cgiurl\">\n"; > print "<center><table border=0>\n"; > print "<tr><th align=left>Your Name:<td><input type=text > name=\"realname\"value=\"$FORM{'realname'}\" size=50><br></td></th></tr> > \n"; > print "<tr><th align=left>URL:<td><input type=text > name=\"url\"value=\"$FORM{'url'}\" size=50><br></td></th></tr>\n"; > print "<tr><th align=left>E-Mail:<td><input type=text > name=\"username\"value=\"$FORM{'username'}\" size=50><br></td></th></tr>\n"; > print "<tr><th align=left>City:<td> <input type=text name=\"city\" > value=\"$FORM{'city'}\"size=15</td></th></tr>\n "; > print "<tr><th align=left>State:<td> <input type=text > name=\"state\"value=\"$FORM{'state'}\" size=15></td></th></tr>\n "; > print "<tr><th align=left> Country:<td><input type=text name=\"country\" > value=\"$FORM{'country'}\" size=15></td></th></tr>\n"; > print "<tr><th align=left>Comments:<td><textarea Name=\"comments\" COLS=60 > ROWS=4 wrap=physical>$FORM{'comments'}</textarea></td></th></tr>\n"; > print "</table></center>\n"; > print "<center><input type=submit> * <input type=reset></form></center>\n"; > print "<center>Return to the <a > href=\"$guestbookurl\">Guestbook</a>.</center>"; > print "\n > ____ . The WDVL Discussion List from WDVL.COM . ____<BR> > To Join wdvltalk, Send An Email To: mailto:[EMAIL PROTECTED] <BR> > Send Your Posts To: [EMAIL PROTECTED]<BR> > To set a personal password send an email to [EMAIL PROTECTED] with the > words: "set WDVLTALK pw=yourpassword" in the body of the > email.<BR> > To change subscription settings to the wdvltalk digest version:<BR> > http://wdvl.internet.com/WDVL/Forum/#sub<BR> > <BR> > ________________ http://www.wdvl.com _______________________<BR> > <BR> > You are currently subscribed to wdvltalk as: [EMAIL PROTECTED]<BR> > To unsubscribe send a blank email to %%email.unsub%% > > <BR> > To unsubscribe via postal mail, please contact us at:<BR> > Jupitermedia Corp.<BR> > Attn: Discussion List Management<BR> > 475 Park Avenue South<BR> > New York, NY 10016<BR> > <BR> > Please include the email address which you have been contacted with.<BR> > > > ____ • The WDVL Discussion List from WDVL.COM • ____<BR> > To Join wdvltalk, Send An Email To: mailto:[EMAIL PROTECTED] <BR> > Send Your Posts To: [EMAIL PROTECTED]<BR> > To set a personal password send an email to [EMAIL PROTECTED] with the words: > "set WDVLTALK pw=yourpassword" in the body of the email.<BR> > To change subscription settings to the wdvltalk digest version:<BR> > http://wdvl.internet.com/WDVL/Forum/#sub<BR> > <BR> > ________________ http://www.wdvl.com _______________________<BR> > <BR> > You are currently subscribed to wdvltalk as: [EMAIL PROTECTED]<BR> > To unsubscribe send a blank email to [EMAIL PROTECTED] > > <BR> > To unsubscribe via postal mail, please contact us at:<BR> > Jupitermedia Corp.<BR> > Attn: Discussion List Management<BR> > 475 Park Avenue South<BR> > New York, NY 10016<BR> > <BR> > Please include the email address which you have been contacted with.<BR> > > ____ • The WDVL Discussion List from WDVL.COM • ____<BR> To Join wdvltalk, Send An Email To: mailto:[EMAIL PROTECTED] <BR> Send Your Posts To: [EMAIL PROTECTED]<BR> To set a personal password send an email to [EMAIL PROTECTED] with the words: "set WDVLTALK pw=yourpassword" in the body of the email.<BR> To change subscription settings to the wdvltalk digest version:<BR> http://wdvl.internet.com/WDVL/Forum/#sub<BR> <BR> ________________ http://www.wdvl.com _______________________<BR> <BR> You are currently subscribed to wdvltalk as: [EMAIL PROTECTED]<BR> To unsubscribe send a blank email to [EMAIL PROTECTED] <BR> To unsubscribe via postal mail, please contact us at:<BR> Jupitermedia Corp.<BR> Attn: Discussion List Management<BR> 475 Park Avenue South<BR> New York, NY 10016<BR> <BR> Please include the email address which you have been contacted with.<BR> </BODY></html>\n"; > # Log The Error > if ($uselog eq '1') { > &log('no_comments'); > } > exit; > } > sub no_name { > print "Content-type: text/html\n\n"; > print "<html><head><title>Data Entry Error</title></head>\n"; > #print "<body > background=\"../images/universe.gif\"bgcolor=\"#000000\"text=\"#99FFFF\"link > =\"#66FF66\" vlink=\"#FFFFFF\" alink=\"#FF0066\">\n"; > #print "<body background > =\"bgcolor=\"#EBEBD3\"text=\"#669999\"link=\"#FF9999\" vlink=\"#FFFF33\" > alink=\"#99FF66\">\n"; > print "<body \BGCOLOR=\"#EBEBD3\"text=\"#669999\"link=\"#FF9999\" > vlink=\"#FFFF33\" alink=\"#99FF66\">\n"; > print "You forgot to fill out real name, would you please type in the > required field to complete the guestbook entry.\n"; > print "<hr>\n"; > print "<form method=POST action=\"$cgiurl\">\n"; > print "<center><table border=0>\n"; > print "<tr><th align=left>Your Name:<td><input type=text > name=\"realname\"value=\"$FORM{'realname'}\" size=50><br></td></th></tr> > \n"; > print "<tr><th align=left>URL:<td><input type=text > name=\"url\"value=\"$FORM{'url'}\" size=50><br></td></th></tr>\n"; > print "<tr><th align=left>E-Mail:<td><input type=text > name=\"username\"value=\"$FORM{'username'}\" size=50><br></td></th></tr>\n"; > print "<tr><th align=left>City:<td> <input type=text name=\"city\" > value=\"$FORM{'city'}\"size=15</td></th></tr>\n "; > print "<tr><th align=left>State:<td> <input type=text > name=\"state\"value=\"$FORM{'state'}\" size=15></td></th></tr>\n "; > print "<tr><th align=left> Country:<td><input type=text name=\"country\" > value=\"$FORM{'country'}\" size=15></td></th></tr>\n"; > print "<tr><th align=left>Comments:<td><textarea Name=\"comments\" COLS=60 > ROWS=4 wrap=physical>$FORM{'comments'}</textarea></td></th></tr>\n"; > print "</table></center>\n"; > print "<center><input type=submit> * <input type=reset></form></center>\n"; > print "<center>Return to the <a > href=\"$guestbookurl\">Guestbook</a>.</center>"; > print "\n > ____ . The WDVL Discussion List from WDVL.COM . ____<BR> > To Join wdvltalk, Send An Email To: mailto:[EMAIL PROTECTED] <BR> > Send Your Posts To: [EMAIL PROTECTED]<BR> > To set a personal password send an email to [EMAIL PROTECTED] with the > words: "set WDVLTALK pw=yourpassword" in the body of the > email.<BR> > To change subscription settings to the wdvltalk digest version:<BR> > http://wdvl.internet.com/WDVL/Forum/#sub<BR> > <BR> > ________________ http://www.wdvl.com _______________________<BR> > <BR> > You are currently subscribed to wdvltalk as: [EMAIL PROTECTED]<BR> > To unsubscribe send a blank email to %%email.unsub%% > > <BR> > To unsubscribe via postal mail, please contact us at:<BR> > Jupitermedia Corp.<BR> > Attn: Discussion List Management<BR> > 475 Park Avenue South<BR> > New York, NY 10016<BR> > <BR> > Please include the email address which you have been contacted with.<BR> > > > ____ • The WDVL Discussion List from WDVL.COM • ____<BR> > To Join wdvltalk, Send An Email To: mailto:[EMAIL PROTECTED] <BR> > Send Your Posts To: [EMAIL PROTECTED]<BR> > To set a personal password send an email to [EMAIL PROTECTED] with the words: > "set WDVLTALK pw=yourpassword" in the body of the email.<BR> > To change subscription settings to the wdvltalk digest version:<BR> > http://wdvl.internet.com/WDVL/Forum/#sub<BR> > <BR> > ________________ http://www.wdvl.com _______________________<BR> > <BR> > You are currently subscribed to wdvltalk as: [EMAIL PROTECTED]<BR> > To unsubscribe send a blank email to [EMAIL PROTECTED] > > <BR> > To unsubscribe via postal mail, please contact us at:<BR> > Jupitermedia Corp.<BR> > Attn: Discussion List Management<BR> > 475 Park Avenue South<BR> > New York, NY 10016<BR> > <BR> > Please include the email address which you have been contacted with.<BR> > > ____ • The WDVL Discussion List from WDVL.COM • ____<BR> To Join wdvltalk, Send An Email To: mailto:[EMAIL PROTECTED] <BR> Send Your Posts To: [EMAIL PROTECTED]<BR> To set a personal password send an email to [EMAIL PROTECTED] with the words: "set WDVLTALK pw=yourpassword" in the body of the email.<BR> To change subscription settings to the wdvltalk digest version:<BR> http://wdvl.internet.com/WDVL/Forum/#sub<BR> <BR> ________________ http://www.wdvl.com _______________________<BR> <BR> You are currently subscribed to wdvltalk as: [EMAIL PROTECTED]<BR> To unsubscribe send a blank email to [EMAIL PROTECTED] <BR> To unsubscribe via postal mail, please contact us at:<BR> Jupitermedia Corp.<BR> Attn: Discussion List Management<BR> 475 Park Avenue South<BR> New York, NY 10016<BR> <BR> Please include the email address which you have been contacted with.<BR> </BODY></html>\n"; > > > > # Log The Error > if ($uselog eq '1') { > &log('no_name'); > } > exit; > } > # Log the Entry or Error > sub log { > $log_type = $_[0]; > open (LOG, ">>$guestlog"); > if ($log_type eq 'entry') { > print LOG "$ENV{'REMOTE_HOST'} - [$shortdate]<br>\n"; > } > elsif ($log_type eq 'no_name') { > print LOG "$ENV{'REMOTE_HOST'} - [$shortdate] - ERR: No Name<br>\n"; > } > elsif ($log_type eq 'no_comments') { > print LOG "$ENV{'REMOTE_HOST'} - [$shortdate] - ERR: No "; > print LOG "Comments<br>\n"; > } > } > # Redirection Option > sub no_redirection { > # Print Beginning of HTML > print "Content-Type: text/html\n\n"; > print "<html><head><title>Thank You</title></head>\n"; > #print "<body > background=\"../images/universe.gif\"bgcolor=\"#000000\"text=\"#99FFFF\"link > =\"#66FF66\" vlink=\"#FFFFFF\" alink=\"#FF0066\">\n"; > print "<body \BGCOLOR=\"#Ebebd3\"text=\"#669999\"link=\"#FF9999\" > vlink=\"#FFFF33\" alink=\"#99FF66\">\n"; > # Print Response > print "Thank you for filling in the guestbook. Your entry has\n"; > print "been added to the guestbook.<hr>\n"; > print "Here is what you have submitted:<p>\n"; > print "<blockquote>\n"; > print "<b>Name:</b>$FORM{'realname'}<br>\n"; > if ($FORM{'url'}) { > print "<b>URL:</b><a href=\"$FORM{'url'}\">$FORM{'url'}</a><br>\n"; > } > else { > print "$FORM{''}"; > } > if ( $FORM{'username'} ){ > if ($linkmail eq '1') { > print "<b>E-Mail:</b> <<a href=\"mailto:$FORM{'username'}\">\n"; > print "$FORM{'username'}</a>><br>\n"; > } > else { > print " <$FORM{''}>\n"; > } > } > > print "<br>\n"; > if ( $FORM{'city'} ){ > print "<b>City:</b>$FORM{'city'}<br>\n"; > } > if ( $FORM{'state'} ){ > print "<b>State:</b> $FORM{'state'}<br>\n"; > } > if ( $FORM{'country'} ){ > print "<b>Country:</b> $FORM{'country'}<br>\n"; > } > print "<b>Date:</b> - $date<p><br>\n"; > print "<b>Comments:</b><DD>$FORM{'comments'}</DL>\n"; > print "</blockquote>\n"; > # Print End of HTML > print "<hr>\n"; > print "<a href=\"$guestbookurl\">Back to the Guestbook</a>\n"; > print "- You may need to reload it when you get there to see your\n"; > print "entry.\n"; > > > Thank you for choosing ComputerPerceptions.com 405-840-2355 Voice 405-245-4087 Mobile 405-858-0249 Fax