#!/usr/bin/perl require './jcode.pl'; &decode; if ($mode eq 'regist'){ ®ist; } elsif ($mode eq 'delete'){ &delete } &html; #html sub html{ #HTMLの表示 print <<"HTML"; Content-type: text/html
HTML
#コメント部分の表示
open(IN,"b.dat");
@log =
";}
print <<"END";
END
exit;
}
sub decode{
$method = $ENV{ 'REQUEST_METHOD' };
if( $method eq 'GET' ) {
$input = $ENV{ 'QUERY_STRING' };
} else {read( STDIN,$input,$ENV{ 'CONTENT_LENGTH' } );}
@in = split(/&/,$input);
foreach (@in) {
($list, $value) = split(/=/);
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; &jcode'convert(*value, 'sjis');
$form{$list} = $value;
}
$mode = $form{'mode'};
$comment = &tag($form{'comment'});
$no = $form{'no'};
}
sub regist{
open(IN,"b.dat");
@log =
/g;
$_[0] =~ s/\r/
/g;
$_[0] =~ s/\n/
/g;
return $_[0];
}
__END__