CAPTCHA Image Generation Part 2
Posted on July 19, 2007
A quick morning hack - I added some random lines to try and confuse the automated processes. Its probably still not very secure but it's a start!
Add the following code below the last imagettftext() line.
$image_info = getimagesize("badge4.png");
$i = 1;
while ($i <= 10) {
$random_line_colour = ImageColorAllocate($base_image, rand(0,255), rand(0,255), rand(0,255));
imageline($base_image,rand(10,$image_info[0]), rand(10,$image_info[1]), rand(10,$image_info[0]), rand(10,$image_info[1]),$random_line_colour);
$i++;
}
It will end up similiar to this
Related posts
- KB_CAPTCHA – CAPTCHA Image Generation in PHP
Introduction KB_Captcha is a simple PHP script to generate reasonably safe CAPTCHA image to secure... - CAPTCHA Image Generation
I couldn't find a very good CAPTCHA generation script in PHP, all the ones I... - Yellow text?
I stumbled over a strange bug on two systems the other day where the imagettftext()... - iCalendar Generation
One of my clients requested that the CRM applicationI wrote should interact with Outlook Calender.... - JPGraph Part 1
I really like JPGraph now. For too long I hated it as a clunky, bloated...



