The following is the verification code generated. The result is tested on this site by the programmer. No error is reported. If there is something you don't understand, you can reply. The programmer will explain what you don't know. I hope I will get something from you.
- <? Php
- Session_start ();
- $ Nums = rand );
- $ _ SESSION [nums] = $ nums;
- $ Imgs = ImageCreatetruecolor (100, 35 );
- $ One = Imagecolorallocate ($ imgs, 0, 0, 0 );
- $ Two = Imagecolorallocate ($ imgs, rand (0,255), rand (0,255), rand (0,255 ));
- $ Thr = Imagecolorallocate ($ imgs, rand (50,200), rand (100,255), rand (150,255 ));
- Imagestring ($ imgs, 6, rand (5, 60), rand (3, 18), $ nums, $ two );
- For ($ I = 1; $ I <= 3; $ I ){
- Imageline ($ imgs, rand (0, 0), R and (0, 25), rand (70,100), rand (0, 25), $ thr );
- }
- For ($ I = 1; $ I <= 200; $ I ){
- Imagesetpixel ($ imgs, rand () 0, rand () 5, $ two );
- }
- Header ("Content-type: image/jpeg ");
- Imagejpeg ($ imgs );
- ?>