dejo codigo
Código PHP:
Ver original
<?php // Start the session so we can store our generated key inside it for later retrieval // Set to whatever size you want, or randomize for more security $captchaTextSize = 7; do { // Generate a random string and encrypt it with md5 // Remove any hard to distinguish characters from our hash // we need only 7 characters for this captcha // Add the newly generated key to the session. Note, it is encrypted. // grab the base image from our pre-generated captcha image background /* Select a color for the text. Since our background is an aqua/greenish color, we choose a text color that will stand out, but not completely. A slightly darker green in our case. */ /* Select a color for the random lines we want to draw on top of the image, in this case, we are going to use another shade of green/blue */ // get the size parameters of our image // decide how many lines you want to draw $linesToDraw = 10; // Add the lines randomly to the image for( $i = 0; $i < $linesToDraw; $i++ ) { // generate random start spots and end spots // Draw the line to the captcha } /* Draw our randomly generated string to our captcha using the given true type font. In this case, I am using BitStream Vera Sans Bold, but you could modify it to any other font you wanted to use. */ // Output the image to the browser, header settings prevent caching ?>
Saludos a todos y gracias de antemano..
saludos
fede