Joke Collection Website - Blessing messages - Seek the complete PHP verification code.
Seek the complete PHP verification code.
header(" content-Type:image/gif "); Function getRandStr($len=4, $type=0){
mt _ srand(microtime(true)* 10000);
$ num =“”;
//Get the number
for($ n = 48; $ n & lt58; $n++){
$num。 = chr($ n);
} $ xiaoie =“”;
//Get lowercase
for($ m = 97; $ m & lt 123; $m++){
$ Xiao Xie. = chr($ m);
} $ daie =“”;
//Get uppercase
for($ n = 65; $ n & lt9 1; $n++){
$ Daxie. = chr($ n);
}
Switch ($ type)
Case 0:
$allstr=$num。 $ Daxie. $ Xiao Xie;
Break;
Case 1:
$ allstr = $ num
Break;
Case 2:
$allstr=$daxie。 $ Xiao Xie;
Break;
Default value:
$allstr=$num。 $ Daxie. $ Xiao Xie;
Break;
}
$ strlen = strlen($ all str);
if($ len & gt; $strlen)
Return'';
$ rand =“”;
for($ l = 0; $ l & lt$ len$l++){
Dollar rand. =$allstr{mt_rand(0,$ strlen- 1)};
}
Return to $ rand;
}
$ w = 80
$ h = 30// Create canvas
$im=imagecreate($w,$ h); //Create a true color canvas with the same effect as above.
//$im=imagecreatetruecolor($w,$ h); //Set the background color
$ BG _ color = imagecolorlallocate($ im,rand( 100, 150),rand(200,255),rand( 100, 150)); //Set the color of the blur point.
$ mohu _ color = imagecolorloculate($ im,mt_rand(20,50),mt_rand(20,50),mt_rand( 100,200));
//Blur the background.
for($ I = 0; $ i & lt 100; $i++){
imagesetpixel($im,rand( 1,$w- 1),rand( 1,$h- 1),$ mohu _ color);
}//Set the line color
$ line _ color = imagecolorlocate($ im,mt_rand(20,50),mt_rand(20,50),mt_rand( 100,200));
for($ j = 0; $ j & lt5; $j++){
//Draw a line
imageline($im,mt_rand(0,$w),mt_rand(0,$h),mt_rand(0,$w),mt_rand(0,$w),$ line _ color);
} $ randstr = getrandStr();
$ _ SESSION[' rand code ']= $ randstr; $ font _ color = imagecolorlallocate($ im,mt_rand(20,50),mt_rand(20,50),mt_rand( 100,200));
$font= "。 /Fonts/ARIALNI。 TTF”;
//Wang picture plus string
imagettftext($im, 14,rand(0,6), 15,20,$font_color,$font,$ randstr); //Generate GIF pictures
imagegif($ im); //Destroy the map
imagedestroy
& gt
- Related articles
- A short ghost story that scares students.
- How to cancel SMS verification when logging in Taobao?
- Blessing message for senior sister.
- What are the idioms of pens?
- How to send MMS on Android phone? How to save MMS?
- Why didn't you get a message to remind you of the money on your bank card?
- SMS notification of the account involved in the case
- Will credit card repayment be notified by SMS?
- Kindergarten winter vacation notice 800 words
- Your credit card has passed the preliminary examination. What does it mean to invite you to bring your ID card to China Merchants Bank for signature confirmation by SMS?