Adult Script Pro Community Forums

Create, help and share your ideas with the community!

You are not logged in.

#1 2011-02-03 21:21:44

Pornogoddess
Member
From: NY
Registered: 2011-01-12
Posts: 183
Website

New CAPTCHA code

Is there a way to have different versions for the CAPTCHA code? I'm used to them and can usually read them without problem (I've usually seen them as black and white). When signing up for a user account myself, just to try it, I realized that it is extremely frustrating, and the colored background would make it next to impossible for someone who is color blind to be able to read it. Even though you can click 'Can't read it?' it takes quite a while before you can find one that you can read. I don't want my users to get frustrated by this and leave.

Offline

#2 2011-02-03 22:17:50

symtab
Administrator
Registered: 2010-08-23
Posts: 7,501
Website

Re: New CAPTCHA code

Edit config/captcha.php and replace:

'level' => 'medium',

with:

'level' => 'easy',

Let me know if that helps.


Adult Scripts: Adult Script Pro - Adult Search Script
Adult Advertising/Traffic: Plug Rush - EXOClick - PopAds

Offline

#3 2011-02-06 03:09:24

Pornogoddess
Member
From: NY
Registered: 2011-01-12
Posts: 183
Website

Re: New CAPTCHA code

Perfect, thanks!

Offline

#4 2011-08-23 16:59:38

jpbogarte
Member
From: Brasil
Registered: 2011-08-17
Posts: 15

Re: New CAPTCHA code

how do I remove the background color?
I wish it were black and white.

Offline

#5 2011-08-23 19:05:31

MS_DA
Member
Registered: 2011-04-26
Posts: 401
Website

Re: New CAPTCHA code

Well i suggest to be very carefully with making the captcha too easy to read. Humen can identify it and once you had to remove about 16 k topics / posts made by a bot u know why i warn yikes

Offline

#6 2011-08-24 01:21:24

jpbogarte
Member
From: Brasil
Registered: 2011-08-17
Posts: 15

Re: New CAPTCHA code

Hi MS_DA I do not intend to remove the captcha, I just want to change the background color to get better at reading.

Offline

#7 2011-08-24 16:14:35

jpbogarte
Member
From: Brasil
Registered: 2011-08-17
Posts: 15

Re: New CAPTCHA code

Hello, I am a person who likes to collaborate with others.

I changed the captcha code for a more complete version that I used in my old script.

In this version you have control over the amount of characters you want to display your username when you register it on the site.
You can also control the background color.

Below is the source code.

You should put it in config / captcha.php

Ok good job to all


Original Code
/*
//----------------------- Original Code ----------------------------------------------------
defined('_VALID') or die('Restricted Access!');
return array(
    'driver' => 'image',
    'level' => 'easy',
    'words' => 'random',
    'width' => 170,
    'height' => 50,
    'recaptcha_public_key' => '',
    'recaptcha_private_key' => '',
    'fonts' => array('Vera.ttf', 'Custom.ttf', 'arialbi.ttf')
);
//----------------------- end code ----------------------------------------------------
*/

//---------------------------------New code-------------------------------------------

session_start();
$possible_chars="23456789QWERTYUPADFGHJLXCVBNM"; //define your characters here
$code="";
$i=0;
//set the captcha length - change 8 to other value
while($i<8) {
  $char=substr($possible_chars,mt_rand(0,strlen($possible_chars)-1),1);
  if (!strstr($code,$char)) {
    $code.=$char;
    $i++;
  }
}
$_SESSION["captcha_code"]=$code;
$width="80"; //width
$height="25"; //height
$image=imagecreate($width,$height);
$bg=imagecolorallocate($image,0,0,0); //background color
$text=imagecolorallocate($image,255,255,255); //text color
$line=imagecolorallocate($image,0,0,0); //fuziness
for($i=0;$i<($height*$width)/2;$i++) imagefilledellipse($image,mt_rand(0,$height),mt_rand(0,$width),1,1,$line);
for($i=0;$i<($height*$width)/150;$i++) imageline($image,mt_rand(0,$height),mt_rand(0,$width),mt_rand(0,$height),mt_rand(0,$width),$line);
imagestring($image,5,4,5,$code,$text);
header("Content-type: image/png");
imagepng($image);

//---------------------------------End code-------------------------------------------

Offline

Board footer

Powered by FluxBB