#!/usr/local/bin/perl
require './jcode.pl';
require './ini.cgi';
### ↓サブルーチン呼び出し
#
&decode;
&HTML_header;
&HTML;
&HTML_footer;
### ↓サブルーチン
#
########
# HTML #
########
#----------------------------------------------------------------------------------
sub HTML{
print <<"munba";
munba
}
#----------------------------------------------------------------------------------
############
# ヘッダー #
############
#---------------------------------------------
sub HTML_header{
print "Content-type: text/html\n\n";
print <<"header";
$title
header
}
#---------------------------------------------
############
# フッター #
############
#--------------------------------
sub HTML_footer{
print "\n";
footer
}
#--------------------------------
############
# デコード #
############
#--------------------------------------------------------------------------------------------
sub decode{
my $method = $ENV{'REQUEST_METHOD'};
$buffer_length = $ENV{'CONTENT_LENGTH'};
if($buffer_length >= 18){&message("名前または暗証番号が長すぎます"); exit;}
if($method eq 'POST'){
read(STDIN,$buffer,$buffer_length);
}else{
$buffer = $ENV{'QUERY_STRING'};
}
my @data = split(/&/,$buffer);
foreach $line(@data){
my ($from_form,$value) = split(/=/,$line);
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
&jcode'convert(*value,'sjis');
$value =~ s/&/&/g;
$value =~ s/</g;
$value =~ s/>/>/g;
$value =~ s/<>/<>/g;
$value =~ s/\r\n/
/g;
$value =~ s/\r/
/g;
$value =~ s/\n/
/g;
$FORM{$from_form} = $value;
}
$name = $FORM{name};
$pass = $FORM{pass};
}
#--------------------------------------------------------------------------------------------
##################
# メッセージ表示 #
##################
#--------------------------------------------------------------------------------------------
sub message{
print "Content-type:text/html\n\n";
print <
$title
$aka$_[0]$f $b
$h
message
&HTML_footer
}
#
#--------------------------------------------------------------------------------------------
exit;