#! /usr/local/bin/perl #################################################### #BooNewsClipboard-SE- v1.02 / this program is free.# #(C) BooBooClub 2002-2006 # #################################################### #set data $pass = 'pass'; $dat = './target.html'; $htmltag = 'disallow'; $rtn = 'off'; #read_lib require 'jcode.pl'; #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/\cM\n//g; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; #$value =~ s/\,//g; if($htmltag ne 'allow'){ $value =~ s/</ig; $value =~ s/>/>/ig; } if($rtn eq 'on'){ $value =~ s/\r\n|[\r\n]//ig; } &jcode'convert(*value,'sjis'); $FORM{$name} = $value; } #branch if($FORM{'write'}){ ✓ &write; &html; } else { &html; } sub check { if ($FORM{'pass'} ne $pass) { &error; } } sub write { open (DAT,"$dat"); @dats = ; close (DAT); $dats = join('',@dats); $dats =~ s/()[\w\W]*()/$1$FORM{'txt'}$2/; if($dats =~ /\r\n/){ $dats =~ s/\r\n|[\r\n]/\n/ig; } open (DAT,">$dat"); print DAT $dats; close (DAT); } sub html { #get dat open (DAT,"$dat"); @dats = ; close (DAT); $dats = join('',@dats); $dats =~ m/([\w\W]*)/; $dats = $1; #html print "Content-type: text/html\n\n"; print "BooNewsClipboard-SE-\n"; print "\n"; print "\n"; print "BooNewsClipboard-SE-\n"; print "\n"; print "\n"; print "\n"; print "TargetFile :$dat\n"; print "\n"; print "News :\n"; print "$dats\n"; print "\n"; print "\n"; print "Password:\n"; print "\n"; print " "; print " \n"; print "\n"; print "\n"; print "\n"; print "\n"; print "Produced by BooBooClub\n"; print "\n"; exit 0; } sub error { print "Content-type: text/html\n\n"; print "Error\n"; print "\n"; print "Error\n"; print "パスワードに誤りがあります。\n"; print "\n"; exit 0; }