½ÃÀÛÆäÀÌÁö·Î Áñ°Üã±âÃß°¡
·Î±×ÀÎ
ȸ¿ø°¡ÀÔ l Ã⼮üũ l ¸¶ÀÌÆäÀÌÁö l CGIMALL
ÀÚ·á½Ç »çÀÌÆ®µî·Ï ·©Å·100 ÇÁ·Î±×·¥¸®ºä °ü¸®ÀÚÃßõÀÚ·á Ãʺ¸°¡À̵å
Ä¿¹Â´ÏƼ
Àüü ÆîÃ帱â
Äü¸Þ´º¸µÅ© jquery , CSS , PHP , Javascript , ¹«·áÆùÆ® , ASP
»ó¼¼°Ë»ö
Ȩ > Ä¿¹Â´ÏƼ > Áú¹®°ú´äº¯ »ó¼¼º¸±â
Ä¿¹Â´ÏƼ ±¸Àα¸Á÷
»çÀÌÆ®µî·Ï
Ŭ¶ó¿ìµåű×
Javascript
PHP
asp
CSS
html
mysql
jquery
image
Mobile
API
slide
°Ô½ÃÆÇ
¸Þ´º
ÇöÀçÁ¢¼ÓÀÚ ¸í »õ·Î°íħ
°Ô½ÃÆÇŸÀÌƲ Áú¹®°ú´äº¯ / »ó¼¼º¸±â
Æ®À§ÅÍ·Î º¸³»±â
Ãßõ¼ö 109 | Á¶È¸¼ö 4,016 | µî·ÏÀÏ 2003-12-08 15:58:13

´Ð³×ÀÓ

sunny97

À̸ÞÀÏ

orange123@orgio.net

Á¦¸ñ

Perl·Î °Ô½ÃÆÇ ¸¸µé±âÁß.. GEtÀ¸·Î ³Ñ¾î¿Â µ¥ÀÌÅÍ
³»¿ë

¾È³çÇϼ¼¿ä Perl·Î °Ô½ÃÆÇÀ» Â¥°í Àִµ¥ ±Ã±ÝÇÑ°ÍÀÌ ÀÖ½À´Ï´Ù. 
²À Á» µµ¿ÍÁÖ¼¼¿ä

´Ù¸§ÀÌ ¾Æ´Ï¿À¶ó,
¸¸¾à get¹æ½ÄÀ¸·Î id°¡ ³Ñ¾î¿Â´Ù¸é
/view.cgi?msg_id=$msg_id
ÀÌ·±½ÄÀ¸·Î¿ä.. ±×·³ $msg_id¸¦ ¾²·Á¸é ¾î¶»°Ô ¼³Á¤ ÇØÁà¾ß Çϳª¿ä?
CGI.pm¸ðµâÀ» ¾²Áö ¾Ê°í.. ¾²´Â ¹æ¹ýÀ» ã°í ÀÖ½À´Ï´Ù.

¾Æ·¡Ã³·³ ¼³Á¤Çß´õ´Ï.. ¾ÈµÇ´Â°Å °°Àºµ¥¿ä. °í¼ö´Ôµé µµ¿òÀ» Á» ºÎŹµå¸³´Ï´Ù.
my $msg_id =$in{'msg_id'};
ÀÌ·¸°ÔÇϸé url¿¡ ³Ñ¾î¿À´Â º¯¼ö¸¦ ¹ÞÀ»¼ö Àִ°Š¾Æ´Ñ°¡¿ä> -_-;;;;;;


   my $input;
   my $method = $ENV{'REQUEST_METHOD'};


   if ($method eq 'POST')
   {
       binmode(STDIN);
       read(STDIN, $input, $ENV{'CONTENT_LENGTH'});
   }
   else
   {
       $input = $ENV{'QUERY_STRING'};
   }

   my $pair;
   my($key, $val, %in);
   foreach $pair (split /&/, $input) {
           $pair =~s/\+/ /g;
           ($key, $val) = split(/=/, $pair, 2);


           $key =~ s/%(..)/pack("H2",$1)/ge;
           $val =~ s/%(..)/pack("H2",$1)/ge;

           $in{$key} =$val;
}

my $msg_id =$in{'msg_id'};

 

 

¾Æ·¡Ã³·³ ¸®½ºÆ®Áß Å¬¸¯ÈÄ ³»¿ëÀ» º¸·Á µé¾î°¡¸é.. Çϳªµµ µ¥ÀÌÅ͵éÀÌ Çϳªµµ ¾È³ª¿Í¿ä -_-;

        my ( $title, $name, $email, $message, $uptime, $rcount) = getMessage($dbh, $msg_id);
        $rcount ++;

        my $sql = "update bbs set count=count+1 where msg_id='$msg_id'";

        my $sth = $dbh->prepare($sql) or die print "DBI::errstr\n";

        $sth->execute if $sth;
        $dbh->disconnect;


        my $tbl;
        $tbl .=qq!<tr><td>$FF<h3>$title</h3>$FA</td></tr><tr bgcolor="#ffffef"><td>$FF$message$FA</td></tr><tr><td border="right">!;
        $tbl .=qq!<table border="0"><tr><td>$FF¿Ã¸°ÀÌ$FA</td><td>$FF$name<a href="mailto:$email">$email</a>$FA</td></tr><tr><td>$FF¿Ã¸°½Ã°¢$FA</td><td>$FF:$uptime&nbsp;&nbsp;&nbsp;Á¶È¸¼ö;<font color="green">$rcount</font>$FA</td></tr></table>!;

 

sub getMessage {

 

 my $sth = $dbh->prepare("select msg_id, title, name, email, message, uptime, count from bbs where msg_id = '$msg_id'");

        $sth->execute;
        my ($msg_id,$title,$name,$email,$message,$uptime,$rcount) = $sth->fetchrow_array;


        $sth -> finish;

        my $r;
        foreach $r (\$name, \$title, \$message ) {
                $$r =~ s/&/&amp;/g;
                $$r =~ s/>/&gt;/g;
                $$r =~ s/</&lt;/g;
                $$r =~ s/\"/&quot;/g;
        }


        ($title, $name, $email, $message, $uptime, $rcount);
}

 

Ãßõ½ºÅ©·¦¼Ò½ºº¸±â ¸ñ·Ï
ÀÌÀü°Ô½Ã±Û [Áú¹®] Æû¸ÞÀÏ ¸¸µé±â... 2003-12-06 07:10:24
´ÙÀ½°Ô½Ã±Û ÀÇ·Ú°ü·ÃÁú¹®ÀÔ´Ï´Ù. 2003-12-08 18:21:25