Fixing osDate captcha

If you've installed osDate, one of the first things you notice is that the captcha is very difficult to read.  It's simply overkill.  This stops bots from signing up, but it also stops many users.  The captcha should be made much easier.  Luckily, it's easy to fix the problem.

Open the file captcha/SecurityImage.php and make the following changes (feel free to make your own modifications as well, but if so test extensively).  

At line 23, change the array of allowable characters to include only the easily-distinguishable characters:

$chars = array ("A", "B", "C", "D", "E", "K", "M", "P", "T", "W", "4", "X") ;

At line 34, change the defaults for the captcha length and font size:

$this->strLength = 4 ;
$this->fontsize = 24;
$this->num_dots = 100;

At line 80, change the spacing of the letters:

$this->writeLetter($this->text[$i],(20 + $i * 30));

At line 110, change the vertical placement:

$yvalue = 35 - mt_rand(0, 10);
$angle = mt_rand(-10,10);

With these modified settings, your users will now actually be able to read the capcha characters and be able to sign up.


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Captcha Info Didn't Work 4 Me

I'd like some help getting captcha to work. Thanks!


If you have a specific error you can post, I  might be able to help.  If you need me to do a little freelance work for you that's no problem also - just follow the Contact link in the address bar to request a quote.

thank you

you are a genius worked like a charm thank you so much.... still fixing up my dating site...if anyone is interested


I'm glad to hear you've got it working.  Good luck with your site.  Feel free to use the contact form here if you come across anything else you need help with on osDate.  If I have come across that and have some code to fix it, I'll post a blog entry about it.