#!/usr/bin/perl use CGI::Carp qw(fatalsToBrowser); push (@INC, "/cgi-bin"); require "cgi-lib.pl"; require "cgi_handlers.pl"; $prog = "guestbk1.cgi"; &ReadParse(*rq); use DB_File; print "Content-type: text/html; charset=utf-8 \n\n"; open (ORDERS, ">>guest.txt") or die "File error, $!"; if ($rq{comments} && !$rq{name}) {print "Please input your name for you comments! ";} elsif (!$rq{comments}) {print "Please input your comments! ";} elsif ( $rq{name} && $rq{comments} ) { &update; } print <<"EOT";

Blackjackstory.com/guestbk.cgi Good URL for you to refer 好网址供您参考

You watch good videos; product from any URL you want to share with your friends, it may be your website or you upload or you want sale any things, you can post here
你看好的视频; 您想与朋友分享的任何 URL 中的产品,可能是您的网站或您上传或您想出售的任何东西,您可以在这里发布

Blackjackstory.com good URL
Contact Name|Email|Phone optionCopy your url include http://(option)URL Title or Subject 標題 your Comments 留言
Home Input chinese 中文 Encoding Unicode UTF-8 EOT &list; untie %hash; #close ORDERS; #

#QUERY = $ENV{'QUERY_STRING'} #logon = $rq{$login} or $in{login} #val2 $vl[2] A = $rq{A} B = $rq{B} print<<"EOT";

EOT sub list { print <<"EOT";
Date Time      Contact: Name|Email|Phone
URL title click to link
URL Comments EOT open(FH,"guest.txt") or &deenice("can't open guest.txt: $!"); #while ( my $line = ) { # Print $line; #} my @b = ; @c = sort @b; #print " b = @b \n"; $m = 0; while ($c[$m]) { @kv = split / ==> /, $c[$m]; @v = split /~/, $kv[1]; $ymdhms = substr($v[4], 1, 6)." ".substr($v[4], 7, 6)." "; &printline; $m++; } close(FH); &pagecnt; } sub printline { $v[3] =~ s/
/\n/g; print <<"EOT";
$ymdhms $v[0]
$v[2]
EOT } sub update { ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); $year = $year - 100; $mon = $mon + 1; $timestamp = $sec + $min * 100 + $hour * 10000 + $mday * 1000000 + $mon * 100000000 + $year * 10000000000; $timestamp = "0".$timestamp; $key = 1000000000000 - $timestamp; $rq{comments} =~ s/\n/
/g; $value = join "~", $rq{name}, $rq{email}, $rq{subj}, $rq{comments}, $timestamp; $line = $key." ==> ".$value; print ORDERS "$line \n"; $rq{name}=""; $rq{email}=""; $rq{subj}=""; $rq{comments}=""; print "Thank for your comments : $value
"; close ORDERS; } sub pagecnt { $_ = substr($ENV{'SCRIPT_NAME'}, 9, 11); $cgi = $_; $_ =~ s /cgi/txt/; # Set the file name up. $HcntFile = $_; # # Open and read the file. # $HitCounts is set to 0 if the file doesn't exist. open (COUNTHAND, "<$HcntFile"); $HitCounts = ; # Close the file input and open it to truncate output # Should we worry about locking the file in case another process # uses it? Probably not since if we take that many hits # missing a few won't matter and we're too busy to be concerned. close (COUNTHAND); open (COUNTHAND, ">$HcntFile"); # Increment $Counter, then write it back out. Put up a message # with the new value. Close the file and exit. $HitCounts += 1; print COUNTHAND $HitCounts; # flock (COUNTHAND, 8); close (COUNTHAND); # print "Content-type: text/plain"; print "
$cgi$HitCounts \n"; # print "$HcntFile : $HitCounts \n"; }