#! /usr/local/bin/perl ########################################## #BooNetTalk,v1.92 / this program is free.# #write.cgi (C) BooBooClub 1997-2005 # ########################################## #set_data $linkname = "Back"; $linkurl = "./linkurl"; $cgi = "./bnth.cgi"; $dat = "./ntd.dat"; $head = "BooNetTalk"; $back = 'bgcolor="#ffffff"'; $linkc= 'text="#000000" link="#0000ff" vlink="880088"'; #read lib require 'jcode.pl'; #lock check &lock; sub lock{ $lockfile = "./lock/lockfile"; $retry = 1; until (symlink("$dat", "$lockfile")){ if (++$retry >= 7){ unlink("$lockfile"); exit(0); } sleep(1); } } #time $ENV{'TZ'}='JST-9'; ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); $year = ($year + 1900); $mon++; if ($sec < 10) { $sec = "0$sec";} if ($min < 10) { $min = "0$min";} if ($hour < 10){ $hour = "0$hour";} if ($mon < 10) { $mon = "0$mon";} if ($mday < 10){ $mday = "0$mday";} $time = "$year/$mon/$mday $hour:$min:$sec"; #read if ($ENV{'REQUEST_METHOD'} eq "POST"){ read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); } else{ $buffer = $ENV{'QUERY_STRING'}; } @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/\r\n|[\r\n]//ig; $value =~ s/\,//g; $value =~ s//>/ig; &jcode'convert(*value,'sjis'); $FORM{$name} = $value; } #allow open (DAT,"$dat"); @ntdats = ; close (DAT); &html; sub html { print "Content-type: text/html\n\n"; print "\n"; print "\n"; print "
\n"; print "
\n"; print "
Produced by BooBooClub
\n"; print "発言内容:\n"; print "
\n"; print "名   前:\n"; print "\n"; print "\n"; print "$head  ","\n"; print "$linkname\n"; print "
\n"; print "
\n"; print "
\n"; print "\n"; unlink("$lockfile"); exit 0; }