Captcha-Issues with clarity of letters/numbers

Please report bugs here!

Moderator: Thorsten

Post Reply
griz
Posts: 7
Joined: Thu Oct 05, 2006 6:38 pm

Captcha-Issues with clarity of letters/numbers

Post by griz » Thu Oct 05, 2006 7:07 pm

I have been testing v1.6.5 for a web site I am developing and have been finding that I can not submit questions as the captcha rejects my entry often due to confusing characters. a letter O appears like a Number 0 (Zero).
An I can look like a 1 as well.
Is it possible to make the letters clearer or remove the use of confusing characters all together. I realize the purpose of the captcha, but when it thwarts even legitimate users, it makes it difficult to use. I am setting this up for a school and expect a non technical audience. I'd prefer to have this be as simple a process as possible yet still have safety measures in place.
Thanks,
Scott G.

matteo
Posts: 572
Joined: Sun Nov 20, 2005 6:53 pm
Location: Italy

Post by matteo » Thu Oct 05, 2006 7:43 pm

Hi Scott,
STF (Search The Forum) is your friend ;)
griz wrote:a letter O appears like a Number 0 (Zero).
You can either enter letter 0 or number 0 'cause they are considered equal since PMF 1.6.0.
griz wrote:I'd prefer to have this be as simple a process as possible yet still have safety measures in place.
Read here about how to mitigate the issue.

Regards,
Matteo
phpMyFAQ QA / Developer
Amazon.co.uk Wishlist

griz
Posts: 7
Joined: Thu Oct 05, 2006 6:38 pm

Post by griz » Fri Oct 06, 2006 2:50 am

Thank you Matteo,
Sorry I did not first search the forum. I am new here and thought I would just ask.
I have tried varying the font and this does help.

griz
Posts: 7
Joined: Thu Oct 05, 2006 6:38 pm

Post by griz » Fri Oct 06, 2006 4:08 am

Matteo,

I would like to find a way to eliminate the O and I characters from what is presented in the captcha. In reading the other forum, entries, there was a mention of the file Captcha.php containing the array of letters. Can I presume that removing letters from this array will eliminate them from being presented in the captcha?
Lastly, if this will work, where do I find Captcha.php. I have searched high and low for it and turned up nothing.
Thanks,
Scott

Thorsten
Posts: 15134
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten » Fri Oct 06, 2006 6:35 am

Hi Scott,
Can I presume that removing letters from this array will eliminate them from being presented in the captcha?
sure!
Lastly, if this will work, where do I find Captcha.php. I have searched high and low for it and turned up nothing.
just look into the constructor method PMF_Captcha for this code:

Code: Select all

        $this->letters      = array('1', '2', '3', '4', '5', '6', '7', '8', '9',
                                    'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',
                                    'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',
                                    'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z' );
bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist

david_de
Posts: 72
Joined: Tue Dec 13, 2005 12:09 am

Post by david_de » Fri Oct 06, 2006 5:25 pm

If it is too clear the bots will walk right through it. In that case may as well just turn it off. There is a reason it was set not to be too clear.

griz
Posts: 7
Joined: Thu Oct 05, 2006 6:38 pm

Post by griz » Fri Oct 06, 2006 8:29 pm

david_de wrote:If it is too clear the bots will walk right through it. In that case may as well just turn it off. There is a reason it was set not to be too clear.
I managed to remove the O and Zero, also the letter I. I left in the "1". I used 3 fonts, all that have a 1 with serif. The fonts I chose were freely available online and are odd enough that they would be confusing to a bot.

I figure it is also useless to have a captcha in place that trips up real users so I needed to bring it down just enough and still keep some level of protection.

Thanks for all your advice.

klausing
Posts: 89
Joined: Fri Oct 14, 2005 11:46 am

Post by klausing » Fri Jan 05, 2007 9:06 am

Verry often the last captcha signs are not readable. Is there a way to change the colors for the captcha picture? Please look at attached pictures. There you can see the last signs you can't read.
ImageImageImage

I believe it would be enough if we could set background color to ffffff

7 tests gives 3 unreadable captcha pictures. How can i change this?

(PhPmyFAq v1.6.8. at www.dvbviewerfaq.de)

matteo
Posts: 572
Joined: Sun Nov 20, 2005 6:53 pm
Location: Italy

Post by matteo » Fri Jan 05, 2007 5:28 pm

klausing wrote:Verry often the last captcha signs are not readable. Is there a way to change the colors for the captcha picture? Please look at attached pictures. There you can see the last signs you can't read.
That happens 'cause the random colors chosen for the font color are unfortunately equal to that of the background: I'll look at the issue.
klausing wrote:I believe it would be enough if we could set background color to ffffff

7 tests gives 3 unreadable captcha pictures. How can i change this?
I think that fixing the not-so-rare condition above should be the right solution.
BTW, please, locate, backup and open the [PATH_TO_PMF_INSTALL]/inc/captcha.php file, find the createBackground() function and move this line below from:

Code: Select all

...
        $colorallocate = imagecolorallocate($this->img, rand(220, 255), rand(220, 255), rand(220, 255));
...
to

Code: Select all

...
        $colorallocate = imagecolorallocate($this->img, 255, 255, 255);
...
Ciao,
Matteo
phpMyFAQ QA / Developer
Amazon.co.uk Wishlist

Post Reply