some questions about CAP image verification.

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
mefarsem
Forum Newbie
Posts: 2
Joined: Sun Jun 27, 2010 8:36 pm

some questions about CAP image verification.

Post by mefarsem »

first, here is my cap php code:

Code: Select all

session_start();

header("Content-type: image/png");
$im = @imagecreate(110, 40)
    or die("Cannot Initialize new GD image stream");
$background_color = imagecolorallocate($im, 255, 255, 255);
$text_color = imagecolorallocate($im, 33, 25, 57);
$rand = rand(11111111,99999999);
imagestring($im, 50, 20, 20,  $rand, $text_color);   

$_SESSION['code'] = $rand;

imagepng($im);
imagedestroy($im);
it shows me an image with white background, (and changin' numbers of course).
i whould like to know how can i change the background that displays behind the numbers, and also change numbers color randomaly?

thanks, sorry for my english =)
Post Reply