Jump to content

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.