WordPress.org

Ready to get started?Download WordPress

Forums

Captcha
[resolved] Shortode for adding CAPTCHA to one page (5 posts)

  1. mphoto
    Member
    Posted 9 months ago #

    I've just installed the CAPTCHA plug-in and adjusted the settings, but don't understand how to add to a page. Usually, I just add a shortcode in a page. I also have Fastsecure Contact Form installed, but thought this would be better for signing up for an email list. Using Twenty Eleven theme.

    http://wordpress.org/plugins/captcha/

  2. bestwebsoft
    Member
    Plugin Author

    Posted 9 months ago #

    Hi mphoto,

    Please follow the instructions below.
    = I would like to add Captcha to custom form on my website. How can I do this? =
    1. Install the Captcha plugin and activate it.
    2. Open the file with the form (where you would like to add the captcha to).
    3. Find a place to insert the code for the captcha output.
    4. Insert the necessary lines:

    if( function_exists( 'cptch_display_captcha_custom' ) ) { echo "<input
    type='hidden' name='cntctfrm_contact_action' value='true' />"; echo
    cptch_display_captcha_custom() } ;

    If the form is HTML you should insert the line with the PHP tags:

    <?php
    
     if( function_exists( 'cptch_display_captcha_custom' ) ) { echo
    "<input type='hidden' name='cntctfrm_contact_action' value='true'
    />"; echo cptch_display_captcha_custom(); } ?>

    5. Then you should add the lines to the function of the entered data checking

    if( function_exists( 'cptch_check_custom_form' ) &&
    cptch_check_custom_form() !== true ) echo "Please complete the
    CAPTCHA."

    or

    <?php if( function_exists(
    'cptch_check_custom_form' ) && cptch_check_custom_form() !==
    true ) echo "Please complete the CAPTCHA." ?>

    You could add this line to the variable and display this variable in the
    required place instead of echo "Please complete the CAPTCHA.". If
    there is a variable (responsible for the errors output) in the check
    function, this phrase can be added to this variable. If the function
    returns 'true', it means that you have entered captcha properly. In all
    other cases the function will return 'false'.

    Sincerely,
    Support Team

  3. mphoto
    Member
    Posted 9 months ago #

    Thanks. I just saw this reply (I expected to get an email). I'll try this at some point in the future since I have the other form installed now.

  4. bestwebsoft
    Member
    Plugin Author

    Posted 9 months ago #

    Hi,

    In case you have any questions, please contact us via our support forum http://support.bestwebsoft.com/.

    Sincerely,
    Support Team

  5. Speakerman
    Member
    Posted 2 months ago #

    Could you tell me whereabouts on the page I need to install the code please, I've tried all manner of combinations by adding code to my WordPress page and nothing at all shows on it.

    I have Contact Form 7 installed on the contact page and just want to add Captcha before the submit button.

    When you talk about installing the code in the "file" are you referring to the files on the server, maybe I'm being thick but there seems to be an assumption that all Captcha is done via plugins and not embedded on the page?

    http://www.beautifulcraftphotography.co.uk/?page_id=38

    Many thanks,

    David

Reply

You must log in to post.

About this Plugin

About this Topic