妙悟 ·¨©É ºô¤W§K¶O¥´³Â³¶¹CÀ¸ ¬¥§J¤HX8¤¤¤å§KCD ¾iÅú³N 纸³J¿| PKPOON ±d¤DõMºPªk spada °·¨­ ¸¡¦Ù ¨k¹Ï ¦ê¯]¯È¤y²° h °Êº©¹Ï®w ½´µÜ¥P¤s ¤j懒°ó ¤@ÃM·í¤d ¤j·ç¤h¤s¤ü ²`¦`ÆW¤f©¤¹Ï "³¯¥©¤å" (Idea Pocket)
®T ¼Ö ¥ð ¶¢ ºë «~ ¹Ï ®w ¶Ý ¦n ¤Ñ ¦a ¥Í ¬¡ ¦Ê ¬ì ®a ®x ¥Í ¬¡ ¾Ç ³N ¬ã ¨s
µø Å¥ ®T ¼Ö ¼Æ ½X ¬ì §Þ ¹C À¸ ¤H ¶¡ ¸ê ·½ ¤À ¨É ¦¨ ¤H °Ï ĵ ¹î Á` ³¡

¥¿¦bÂsÄý¦¹ª©¶ôªº·|­û

    ·j¯Á¿ï¶µ¯Á¤Þ¨t²Î¤u¨ãµ¡
    ¥´¦L

    ¸g¤@­Ó¼Æ¦r»P¦r¥À²V¦X»{ÃÒ½XPHPµ{§Ç

    http://manyway.net ÃÙ§Uºô¯¸¸ü¤J¤¤...
    ¥»¥DÃD¥Ñ lesly ©ó 2008-1-28 12:58 PM Ãö³¬

    ¸g¤@­Ó¼Æ¦r»P¦r¥À²V¦X»{ÃÒ½XPHPµ{§Ç

    ³o¬q¥N½X«Ü¤£¿ù¡A§Ú¤@ª½¥Î
    ½Æ»s¤º®e¨ì°Å¶KªO
    ¥N½X:
    <?php
    $codename = "verifycode";
    $border   = true;
    $noise    = true;
    $color['number'] = "#E32A3F";
    $color['letter'] = "#113F72";
    $color['bg']         = "#CCFF00";
    $color['border'] = "#AAB90F";
    $noisenum = 9;  
    $length          = 4;  
    $width          = 60;
    $height   = 20;
    $x = 8; //
    $y = 2; //
    //------ end config ---------

    $image = imagecreate($width, $height);
    $backcolor = getcolor($color['bg']);
    imagefilledrectangle($image, 0, 0, $width, $height, $bgcolor);

    $textall = array_merge(range('A', 'Z'), range(0,9));
    $cW = ($width-1.5*$x)/$length;
    for ($i = 0; $i < $length; $i++) {
        $tmptext = rand(0, 35);
        $randtext = $textall["$tmptext"];
        $code .= $randtext;
            $cX = $x + $i*$cW;
            if(is_numeric($randtext)){
                    $textColor = getcolor($color['number']);
            }else{
                    $textColor = getcolor($color['letter']);
            }
            imagestring($image, 5, $cX, $y, $randtext, $textColor);
    }

    if ($noise)   setnoise();
    if ($border){
            $bordercolor = getcolor($color['border']);
        imagerectangle($image, 0, 0, $width - 1, $height - 1, $bordercolor);
    }

    session_start();
    session_register("{$codename}");
    $_SESSION["{$codename}"] = $code;
    header("Content-type: image/png");
    imagepng($image);
    imagedestroy($image);

    function getcolor($color) {
        global $image;
        $color = eregi_replace("^#", "", $color);
        $r = $color[0] . $color[1];
        $r = hexdec($r);
        $b = $color[2] . $color[3];
        $b = hexdec($b);
        $g = $color[4] . $color[5];
        $g = hexdec($g);
        $color = imagecolorallocate($image, $r, $b, $g);
        return $color;
    }

    function setnoise() {
        global $image, $width, $height, $bgcolor, $noisenum;
        for ($i = 0; $i < $noisenum; $i++) {
            $randColor = imagecolorallocate($image, rand(0, 255), rand(0, 255), rand(0, 255));
            imagesetpixel($image, rand(0, $width), rand(0, $height), $randColor);
        }
    }
    ?>
    [ ¥»©«³Ì«á¥Ñ ¤p½Þ¤£²Â ©ó 2007-6-1 05:19 PM ½s¿è ]

    TOP

    ·PÁµo©«ªÌ