This forum is no longer open and is for reading/searching only.

Please use our new MachForm Community Forum instead.

MachForm Community Forums » MachForm 2

Internal CAPTCHA Changes


  1. webcommerce
    Member

    First off, my thanks for a great form tool. I've been looking for something like this for a long time.

    I want to change the background and text colours in the captcha image. e.g Navy blue text on a pale green background .... Is this possible?

    If so, where would the changes be made??

    Thanks,
    Ron S

    Posted 16 years ago #
  2. Saghalie
    Pro Member

    Ron,

    You will need to edit hooks/custom_hooks.php and define your theme there. At least I believe you can still do this there, I haven't done it in a while though.

    Check out http://recaptcha.net for further info on themes.

    Hope this helps!

    Saghalie

    Posted 16 years ago #
  3. webcommerce
    Member

    Hi Saghalie,

    Sorry, I didn't think to say it in my original post but I'm using internal Captcha.
    I don't think this is very similar to recaptcha?

    Thanks.
    Ron S

    Posted 16 years ago #
  4. webcommerce
    Member

    Well ... if it's of interest to anyone else, I did find the solution to this. The CAPTCHA image is available in glorious colour by making the following change:

    ./lib/php-captcha/php-captcha.inc.php

    look for " // class defaults - change to effect globally "
    change define('CAPTCHA_USE_COLOUR', false);
    to define('CAPTCHA_USE_COLOUR', true);

    To see an example check out my test form at www.callsave.com.au/secure_form.php

    Regards,
    Ron S

    Posted 16 years ago #
  5. Saghalie
    Pro Member

    Nice! thanks for that..

    Posted 16 years ago #
  6. yuniar

    If you need to use single color for the text.
    Let say we would like to have:

    Blue text: 003399
    Green background: 00FF00

    (taken from http://html-color-codes.com/)

    Edit your php-captcha.inc.php, search around line 272 for this code:

    $iTextColour = imagecolorallocate($this->oImage, rand(0, 100), rand(0, 100), rand(0, 100));

    change it to use the blue color:

    $iTextColour = imagecolorallocate($this->oImage, 0x00, 0x33, 0x99);

    Next, search around line 211:

    if ($this->bUseColour) {
        $iLineColour = imagecolorallocate($this->oImage, rand(100, 250), rand(100, 250), rand(100, 250));
    }

    change it to use the green color:

    if ($this->bUseColour) {
        $iLineColour = imagecolorallocate($this->oImage, 0x00, 0xFF, 0x00);
    }

    That would set your colors.


    MachForm Founder

    Posted 16 years ago #
  7. webcommerce
    Member

    Thanks Yuniar, that's excellent.
    I will try that.
    Ron S

    Posted 16 years ago #
  8. howardes
    Member

    @ Ron S

    Can you tell me if the internal Captcha is available to use in MatchForm? If yes any special place I would look to set this as the default for my forms. reCaptcha seems to be much to difficult to "answer test" for me.

    Thanks,

    -howard

    Posted 16 years ago #
  9. redityo

    yes howard, you can use internal captcha in machform, simply edit your config.php file and you will find this line :

    define('USE_INTERNAL_CAPTCHA',false);

    set it as true


    MachForm Support

    Posted 16 years ago #

RSS feed for this topic

Reply