-_-;;;
Á÷Á¢ ¸¸µå½Å°Í °°³×¿ä.
¼ö¸¹Àº ¿À·ùµéÀÌ... °íÄ£°Í¸¸ Çصµ 5°³´Â Á·È÷ µÉµí ...
»õ·Î ¼öÁ¤µÈ ÄÚµåÀÔ´Ï´Ù.
°÷°÷¿¡ ¿À·ù°¡ ÀÖ¾î¿ä. ¿¹¸¦ µé¸é print "...Çؼ "; ÇØ¾ß µÇ´Âµ¥
½Öµû¿ÈÇ¥ ´ë½Å¿¡ ' Àְųª...¸»ÀÌÁÒ.
¾Æ·¡ º¹»çÇؼ ¾²¸é µË´Ï´Ù.
¾ÕÀ¸·Î´Â ÀÌ·±°Å ¹°¾îº¸½É ¾ÈµË´Ï´Ù. ^^
#!/usr/bin/perl
###########################################################################
# ¹æ¸í·Ï(1)
# ÀÔ·Â µ¥ÀÌÅ͸¦ È®ÀÎÇÑ´Ù.
&read_parse;
# µ¥ÀÌÅÍ°¡ ÀԷµÇÁö ¾ÊÀ¸¸é ¿¡·¯È¸éÀ» º¸ÀδÙ.
if((!$FORM{'username'}) || (!$FORM{'comment'})) {
print "Content-Type: text/html\n\n";
print qq~
ÀԷ¿¡·¯ ÀԷ¿¡·¯!!
À̸§°ú ³»¿ëÀ» ±â·ÏÇؾ߸¸ µî·ÏÀÌ µË´Ï´Ù.
ÀÔ·ÂÆäÀÌÁö·Î
~;
exit;
}
else {
# guest.htmÀ» ¿¾î¼ ³¡ºÎºÐ¿¡ ÀÔ·Â µ¥ÀÌÅ͸¦ ±â·ÏÇÑ´Ù.
print "Content-Type: text/html\n\n";
open (A,"a.html") or die print "ref ÆÄÀÏÀ» ãÀ»¼ö ¾ø½À´Ï´Ù";
print A "¼º¸í: $FORM{'username'}
\n";
print A "E-MAIL: $FORM{'email'}
\n";
print A "³»¿ë:
\n";
print A "
: $FORM{'comment'}
\n";
print A "
\n";
close(A);
# ÀÔ·Â ¿Ï·á ȸéÀ» º¸¿©ÁØ´Ù.
print "
°¨»çÇÕ´Ï´Ù.\n";
print "\n";
print "
±Û µî·Ï ¼º°ø!!
\n";
print "¼º¸í: $FORM{'username'}
\n";
print "E-MAIL: $FORM{'email'}
\n";
print "³»¿ë
$FORM{'comment'}
\n";
print "
¹æ¸í·Ï º¸±â\n";
print "\n";
exit;
}
###################################################
# ¼ºê·çƾ ÇÁ·Î±×·¥
# ÀÔ·ÂÅ×ÀÌÅÍ Ã³¸®
sub read_parse {
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
@pairs = split(/&/, $buffer);
foreach $pair (@pairs){
($name, $value) = split(/=/, $pair);
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9]) /park("C", hex($1)) /eg;
$FORM{$name} = $value;
}
}
¾Æ·¡ ºÎºÐÀº ´Ô²² ¸Â°Ô ¼öÁ¤Çؼ ¾²½Ã±¸¿ä.
open (A,"a.html") or die print "ref ÆÄÀÏÀ» ãÀ»¼ö ¾ø½À´Ï´Ù";
ÁÁÀº ÇÏ·çµÇ¼¼¿ä.