¾È³çÇϼ¼¿ä. ÇØÇÇCGI À¥¸¶½ºÅÍ À±¿µ¿õÀÔ´Ï´Ù.
ÇÁ¸°Æ® ¹®À» À§¿¡¼ »ç¿ëÇؾßÁö¿ä. ^^
¾Æ·¡ Äڵ带 ÀüºÎ ±×´ë·Î º¹»çÇؼ ºÙÀ̼¼¿ä.
#!/usr/local/bin/perl
print "Content-type: text/html\n\n";
################# form¿¡¼ µ¥ÀÌŸ Àоî¿À±â #################
&read_form;
print "\n";
print "
ÈÞ¹«½Åû¼ È®ÀÎ\n";
print "\n";
print "\n";
print "
TablePrint1-3
#### ÇÊ¿äÇÑ ¿ä¼Ò ÃßÃâ ######################################################
sub read_form {
%Form = &read_input;
$sabun = $Form{'sabun'};
$hyufrom1 = $Form{'hyufrom1'};
$hyuto1 = $Form{'hyuto1'};
$sayong1 = $Form{'sayong1'};
$hyucode1 = $Form{'hyucode1'};
$sayu1 = $Form{'sayu1'};
$hyufrom1 =~s/\s//g;
$sayong1 =~ s/\s//g;
}
##### CGI ·Î ¹ÞÀº µ¥ÀÌŸ¸¦ ¿¬»ó¹è¿ %FORM ¿¡ ÀúÀå #################################
sub read_input {
local ($buffer, @pairs, $name, $value, %FORM);
if ($ENV{'REQUEST_METHOD'} =~ /^post$/i) {
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
} else {
$buffer = $ENV{'QUERY_STRING'};
}
@pairs = split(/&/, $buffer);
foreach (@pairs) {
($name, $value) = split(/=/, $_);
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$FORM{$name} = $value;
}
return %FORM;
}