The verification code written by PHP. Content-type: imagepng; $ w200; $ h50; $ iimagecreatetruecolor ($ w, $ h); $ bgcimagecolorallocate ($ I, 251,251,251 ); imagefill ($ I, $ bgc); verification code written by functio PHP
Header ('content-type: image/png ');
$ W = 200;
$ H = 50;
$ I = imagecreatetruecolor ($ w, $ h );
$ Bgc = imagecolorallocate ($ I, 251,251,251 );
Imagefill ($ I, 0, 0, $ bgc );
Function getStr ($ len = 4 ){
$ Str = 'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz0123456789 ';
$ S = '';
For ($ I = 0; $ I <$ len; $ I ++ ){
$ S. = $ str {mt_rand (0, strlen ($ str)-1 )};
}
Return $ s;
}
// $ C = imagecolorallocate ($ I, mt_rand (0,255), mt_rand (0,255), mt_rand (0,255 ));
// Imagettftext ($ I, 20, mt_rand (), $ c, 'font/h. ttf', getStr (10 ));
$ S = getStr (6 );
For ($ n = 0; $ n $ C = imagecolorallocate ($ I, mt_rand (0,155), mt_rand (0,155), mt_rand (0,155 ));
Imagettftext ($ I, mt_rand (15, 30), mt_rand (-15, 30), 10 + ($ n * 18), mt_rand (25, 35), $ c, 'font/h. ttf', $ s {$ n });
}
$ S = getStr (20 );
For ($ n = 0; $ n $ C = imagecolorallocatealpha ($ I, mt_rand (0,255), mt_rand (0,255), mt_rand (0,255), 50 );
Imagettftext ($ I, mt_rand (5, 10), mt_rand (-15, 30), mt_rand (0, $ w), mt_rand (0, $ h), $ c, 'font/h. ttf', $ s {$ n });
}
Imagepng ($ I );
Imagedestroy ($ I );
Response header ('content-type: image/png '); $ w = 200; $ h = 50; $ I = imagecreatetruecolor ($ w, $ h ); $ bgc = imagecolorallocate ($ I, 251,251,251); imagefill ($ I, $ bgc); functio...