I don't like a simple verification code, because it costs a lot of weeks, and even font files are available. I often find that some programs only have more than two megabytes, And the font accounts for at least 1.5 MB, alas! I don't know what that person thinks. It's just too creative.
I don't like it, so I wrote a simple and beautiful and efficient one myself.
// If you want to publish this article, please indicate the exit, no outgoing copyright notice, I do not like to see this kind of website. My work website does not indicate the person who is serving Seven {See7di # Gmail.com}
<? Php
$ Work = AddsLashes ($ _ REQUEST ["work"]);
Switch ($ work ){
Case "cod ":
_ Cod ();
Break;
Default:
_ Main ();
Break;
}
//------------------------------------------------*
Function _ main (){
Session_start ();
Echo "}
//------------------------------------------------*
Function _ cod (){
OB_start ();
OB_clean ();
For ($ I = 0; $ I <4; $ I ++) {// dechex converts the 10-in-hexadecimal notation to the 16-in-hexadecimal notation.
$ Num. = Dechex (Mt_Rand (1, 15 ));
}
Session_start (); $ _ SESSION ['cod '] = $ num;
$ Img = Imagecreatetruecolor (60, 20); // create a canvas
$ Bgc = Imagecolorallocate ($ img, 255,255,255); // create an image background color.
Imagefill ($ img, 0, 0, $ bgc );
For ($ I = 0; $ I <Mt_Rand (); $ I ++) {// Add random lines
$ Linc = Imagecolorallocate ($ img, 200,200, Mt_Rand (0,255 ));
Imageline ($ img, Mt_Rand (5, 55), Mt_Rand (5, 15), Mt_Rand (5, 55), Mt_Rand (5, 15), $ linc );
}
For ($ I = 0; $ I <2; $ I ++ ){
$ Col = Imagecolorallocate ($ img, Mt_Rand (100,150), Mt_Rand (0,200); // font color
Imagestring ($ img, 6, (10 + $ I * 9), (2 + $ I * 2), ($ num [$ I]. "-". $ num [($ I + 2)]), $ col); // write text
}
Header ('content-type: Image/png ');
Imagepng ($ img );
Die ();
}
?>