anyone got a working script for this? i can't seem to get anything working that i find when i search...
edit: i found a code to generate an image, and i use rand to generate text on it...
now when i press a submit button, how can i check if the generated text matches the textbox?
Code:<?php $my_img = imagecreate( 60, 20 ); $background = imagecolorallocate( $my_img, 0, 0, 255 ); $text_colour = imagecolorallocate( $my_img, 255, 255, 0 ); $line_colour = imagecolorallocate( $my_img, 128, 255, 0 ); $rand_string = rand(999999, 9999999); imagestring( $my_img, 4, 1, 2, $rand_string, $text_colour ); imagesetthickness ( $my_img, 5 ); imageline( $my_img, 30, 45, 165, 45, 0); header( "Content-type: image/png" ); imagepng( $my_img ); imagecolordeallocate( $line_color ); imagecolordeallocate( $text_color ); imagecolordeallocate( $background ); imagedestroy( $my_img ); ?>




Reply With Quote