×ðÁú¿­Ê±¹ÙÍøµÇ¼

thinkphpÑéÖ¤Âë¹ýʧ²»Ë¢ÐÂÔõô°ì

thinkphpÊÇÒ»¿î»ùÓÚmvcģʽµÄ¿ªÔ´webÓ¦Óÿò¼Ü £¬ËüÌṩÁËÖî¶àÓÅÒìµÄ¹¦Ð§ºÍÌØÕ÷ £¬ÉÁ¿ª·¢ÕßÄܹ»Ô½·¢¸ßЧµØ¿ª·¢webÓ¦Óá£ÆäÖÐÖ®Ò»¼´ÊÇÑéÖ¤Â빦Ч¡£ÑéÖ¤Âë £¬È«³ÆΪ¡°Í¼ÐÎÑéÖ¤Â롱 £¬ÊÇÒ»ÖÖÓÃÓÚ±ÜÃâ¶ñÒâ»úеÈË×¢²á»òµÇ¼µÄÊÖÒÕÊֶΡ£Í¨³£ÇéÐÎÏ £¬µ±Óû§ÊäÈë¹ýʧµÄÑéÖ¤Âëʱ £¬ÍøÕ¾»áˢлòÖØÐÂÌìÉúÒ»ÕÅÑéÖ¤ÂëͼƬ¡£¿ÉÊÇÓÐһЩÓû§Óöµ½ÁËthinkphpÑéÖ¤Âë¹ýʧȴ²»Ë¢ÐµÄÎÊÌâ £¬ÕâÊÇÔõô»ØÊÂÄØ£¿

Ò»¡¢ÎÊÌâÐÎò

ThinkphpÖÐ £¬ÑéÖ¤ÂëµÄÌìÉúºÍУÑéʹÓõÄÊÇThinkphp×Ô´øµÄÑéÖ¤ÂëÀà¿â¡£ÔÚʹÓøÃÀà¿âʱ £¬Óû§»á·¢Ã÷·ºÆðÁËÒ»ÖÖÇéÐÎ £¬¼´µ±ÑéÖ¤ÂëÊäÈë¹ýʧʱ £¬ÍøÕ¾²»»áÁ¬Ã¦Ë¢ÐÂÑéÖ¤Âë¡£ÈôÊÇÓû§Ò»Á¬¶à´ÎÊäÈë¹ýʧµÄÑéÖ¤Âë £¬ÍøÕ¾²¢Ã»ÓиüÐÂÑéÖ¤Âë £¬ÕâÈÃÓû§¸ÐÓ¦ºÜÊÇδ±ã¡£

¶þ¡¢ÎÊÌâÆÊÎö

¸ÃÎÊÌâµÄ·ºÆðÔµ¹ÊÔ­ÓÉÊÇÓÉÓÚÔÚThinkphpµÄÑéÖ¤ÂëÀà¿âÖÐ £¬±£´æÒ»¸öÊôÐÔ$resetΪfalseµÄÒªÁì¡£µ±¸ÃÊôÐÔֵΪfalseʱ £¬¼´²»Ë¢ÐÂÑéÖ¤Âë £¬Ö±ÖÁÓâÆÚΪֹ¡£ÒÔÊǵ±Óû§¶à´ÎÊäÈë¹ýʧµÄÑéÖ¤Âëʱ £¬ÍøÕ¾²»»á¸üÐÂÑéÖ¤Âë¡£

Á¬Ã¦Ñ§Ï°¡°PHPÃâ·ÑѧϰÌõ¼Ç£¨ÉîÈ룩¡±£»

Èý¡¢½â¾öÒªÁì

Õë¶Ô¸ÃÎÊÌâ £¬½â¾öÒªÁìÒ²ºÜ¼òÆÓ £¬Ö»ÐèÒª°Ñ$resetÊôÐÔÖµÐÞ¸ÄΪtrue¼´¿É¡£ÐÞ¸ÄÒªÁìÈçÏ£º

ÔÚThinkPHP/Library/Think/Verify.class.phpÖÐÕÒµ½ÒÔÏ´úÂ룺

   //ÊÇ·ñ»­»ìÏýÇúÏß
   public $useCurve     = true;
   //ÊÇ·ñÌí¼ÓÔÓµã
   public $useNoise     = true;
   //ÑéÖ¤ÂëͼƬ¿í¶È
   public $imageW       = 130;
   //ÑéÖ¤ÂëͼƬ¸ß¶È
   public $imageH       = 50;
   //ÑéÖ¤ÂëλÊý
   public $length       = 4;
   //ÑéÖ¤Âë×ÖÌå¾Þϸ(px)
   public $fontSize     = 25;
   //ÊÇ·ñ»­ÑÕÉ«Åä¾°
   public $useZh        = false;
   //ÑéÖ¤ÂëÖÖ×Ó
   protected $seed     = '123456789QWERTYUIOPASDFGHJKLZXCVBNM';
   //ÌìÉúÑéÖ¤Âë
   public function entry(){
       //ÑéÖ¤Âë×Ö·û
       $this->code = $this->makeCode();
       session($this->seKey,$this->code);//ÑéÖ¤ÂëÉúÑĵ½SESSIONÖÐ
       $width       = ($this->length* $this->fontSize*0.9 + $this->fontSize*1.5);
       $height      = $this->fontSize*2;
       if( $this->useZh ){
           $width  = 230;
           $height = 50;
       }
       //½¨ÉèͼÏñ
       $this->image = imagecreate($width,$height);
       //ÉèÖÃÅä¾°
       if($this->useZh)
           imagecolorallocate($this->image,244, 220, 215);
       else{
           $this->bkcolor = imagecolorallocate($this->image, 255, 255, 255);
           imagefill($this->image,0,0,$this->bkcolor);
       }
       //»ìÏýÇúÏß
       if ($this->useCurve) {
           $this->writeCurve();
       }
       //ÔÓµã
       if ($this->useNoise) {
           $this->writeNoise();
       }
       //ÑéÖ¤Âë
       $this->writeCode();
       header("Cache-Control: max-age=1, s-maxage=1, no-cache, must-revalidate");
       header("Content-type: image/png;charset=utf8");
       imagepng($this->image);
       imagedestroy($this->image);
   }

µÇ¼ºó¸´ÖÆ

½«ÆäÖеÄ$resetÊôÐÔÖµÐÞ¸ÄΪtrue £¬Ð޸ĺóµÄ´úÂëÈçÏ£º

   //ÊÇ·ñ»­»ìÏýÇúÏß
   public $useCurve     = true;
   //ÊÇ·ñÌí¼ÓÔÓµã
   public $useNoise     = true;
   //ÑéÖ¤ÂëͼƬ¿í¶È
   public $imageW       = 130;
   //ÑéÖ¤ÂëͼƬ¸ß¶È
   public $imageH       = 50;
   //ÑéÖ¤ÂëλÊý
   public $length       = 4;
   //ÑéÖ¤Âë×ÖÌå¾Þϸ(px)
   public $fontSize     = 25;
   //ÊÇ·ñ»­ÑÕÉ«Åä¾°
   public $useZh        = false;
   //ÑéÖ¤ÂëÖÖ×Ó
   protected $seed     = '123456789QWERTYUIOPASDFGHJKLZXCVBNM';
   //ÌìÉúÑéÖ¤Âë
   public function entry(){
       //ÑéÖ¤Âë×Ö·û
       $this->code = $this->makeCode();
       session($this->seKey,$this->code);//ÑéÖ¤ÂëÉúÑĵ½SESSIONÖÐ
       $width       = ($this->length* $this->fontSize*0.9 + $this->fontSize*1.5);
       $height      = $this->fontSize*2;
       if( $this->useZh ){
           $width  = 230;
           $height = 50;
       }
       //½¨ÉèͼÏñ
       $this->image = imagecreate($width,$height);
       //ÉèÖÃÅä¾°
       if($this->useZh)
           imagecolorallocate($this->image,244, 220, 215);
       else{
           $this->bkcolor = imagecolorallocate($this->image, 255, 255, 255);
           imagefill($this->image,0,0,$this->bkcolor);
       }
       //»ìÏýÇúÏß
       if ($this->useCurve) {
           $this->writeCurve();
       }
       //ÔÓµã
       if ($this->useNoise) {
           $this->writeNoise();
       }
       //ÑéÖ¤Âë
       $this->writeCode();
       // ÒÔÏÂΪ´úÂëÐÞ¸Ä
       $this->reset = true;
       header("Cache-Control: max-age=1, s-maxage=1, no-cache, must-revalidate");
       header("Content-type: image/png;charset=utf8");
       imagepng($this->image);
       imagedestroy($this->image);
   }

µÇ¼ºó¸´ÖÆ

ÐÞ¸ÄÍêºó £¬ÉúÑIJ¢ÖØÐÂÌá½»¼´¿É¡£

ËÄ¡¢½áÂÛ

±¾ÎÄÏÈÈÝÁËThinkphpÑéÖ¤Âë¹ýʧ²»Ë¢ÐµÄÎÊÌâ·ºÆðÔµ¹ÊÔ­ÓÉÏ¢Õù¾öÒªÁì¡£Ö»ÐèÐÞ¸ÄÒ»ÐдúÂë £¬¼´¿É½â¾ö¸ÃÎÊÌâ¡£ÏÖʵÉÏ £¬ÔÚʹÓÃÈκοò¼Üʱ £¬·ºÆðÎÊÌâµÄÇéÐζ¼ÊDz»¿É×èÖ¹µÄ¡£²»¹ýÖ»ÒªÎÒÃÇÆð¾¢µØȥѰÕÒ½â¾öÒªÁì £¬ÎÊÌâ×ܻᱻ½â¾ö¡£

ÒÔÉϾÍÊÇthinkphpÑéÖ¤Âë¹ýʧ²»Ë¢ÐÂÔõô°ìµÄÏêϸÄÚÈÝ £¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡

ÃâÔð˵Ã÷£ºÒÔÉÏչʾÄÚÈÝȪԴÓÚÏàÖúýÌå¡¢ÆóÒµ»ú¹¹¡¢ÍøÓÑÌṩ»òÍøÂçÍøÂçÕûÀí £¬°æȨÕùÒéÓë±¾Õ¾ÎÞ¹Ø £¬ÎÄÕÂÉæ¼°¿´·¨Óë¿´·¨²»´ú±í×ðÁú¿­Ê±¹ÙÍøµÇ¼ÂËÓÍ»úÍø¹Ù·½Ì¬¶È £¬Çë¶ÁÕß½ö×ö²Î¿¼¡£±¾ÎĽӴýתÔØ £¬×ªÔØÇë˵Ã÷À´ÓÉ¡£ÈôÄúÒÔΪ±¾ÎÄÇÖÕ¼ÁËÄúµÄ°æȨÐÅÏ¢ £¬»òÄú·¢Ã÷¸ÃÄÚÈÝÓÐÈκÎÉæ¼°ÓÐÎ¥¹«µÂ¡¢Ã°·¸Ö´·¨µÈÎ¥·¨ÐÅÏ¢ £¬ÇëÄúÁ¬Ã¦ÁªÏµ×ðÁú¿­Ê±¹ÙÍøµÇ¼ʵʱÐÞÕý»òɾ³ý¡£

Ïà¹ØÐÂÎÅ

ÁªÏµ×ðÁú¿­Ê±¹ÙÍøµÇ¼

18523999891

¿É΢ÐÅÔÚÏß×Éѯ

ÊÂÇéʱ¼ä£ºÖÜÒ»ÖÁÖÜÎå £¬9:30-18:30 £¬½ÚãåÈÕÐÝÏ¢

QR code
ÍøÕ¾µØͼ