Jump to content

[SOLVED] advance captcha


asmith

Recommended Posts

making captcha image with php is so easy . you can set the text font, lines , color ...

 

i see a captcha here :

http://www.aoaforums.com/forum/register.php?do=register

 

it is so colorful , background change every time. 

 

the thing i really really want to learn is :

 

1.how can i rotate "each" letter or number ?  for example rotate 30` . or 45` .

2. how about the background image ? i use solid color for the captcha background, how do they use background image ?

3.seems they've give each letter or number one different color ?

 

here's the some peice of code i usually use :

 

<?php
// create the image resource
$image = ImageCreatetruecolor(150,150);

// set colors
$white 	= ImageColorAllocate($image, 255, 255, 255);
$black 	= ImageColorAllocate($image, 0, 0, 0);

// set background 
imagefill($image, 0, 0, $white);

// set text 
imagettftext($image, 50, -10, 10, 45, $black, 'font.ttf', $the_code);

// set lines
        imagesetthickness($image,2);
imageline($image, 23, 2, 130, 2, $black);

// created image 
imagejpeg($image);
imagedestroy($image);
?>

Link to comment
https://forums.phpfreaks.com/topic/85142-solved-advance-captcha/
Share on other sites

You can rotate an image using imagerotate(), however what I think you "might" need to do is, create an image for each letter, rotate each letter-image, and them merge all images onto a final image. Try that.

I've never done this technique before (always just been satisfied with basic captcha + silly fonts) but there is no reason why it shouldn't work.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.