3 UserCake Version: 2.0.2
\r
7 $md5_hash = md5(rand(0,99999));
\r
8 $security_code = substr($md5_hash, 25, 5);
\r
9 $enc = md5($security_code);
\r
10 $_SESSION['captcha'] = $enc;
\r
15 $image = ImageCreate($width, $height);
\r
16 $white = ImageColorAllocate($image, 255, 255, 255);
\r
17 $black = ImageColorAllocate($image, 0, 0, 0);
\r
18 $grey = ImageColorAllocate($image, 200, 200, 200);
\r
20 ImageFill($image, 0, 0, $white);
\r
21 ImageString($image, 10, 5, 0, $security_code, $black);
\r
23 header("Content-Type: image/png");
\r
25 ImageDestroy($image);
\r