Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi,

    Please follow the instructions below in order to add Captcha plugin to your custom PHP or HTML form:

    1) Install the Captcha plugin and activate it.
    2) Open the file with the form (where you want to add the captcha).
    3) Insert the following code to display captcha:

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

    For HTML form use 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(); } if( function_exists( 'cptchpr_display_captcha_custom' ) ) { echo "<input type='hidden' name='cntctfrm_contact_action' value='true' />"; echo cptchpr_display_captcha_custom(); } ?>

    4) Add the next code to the entered data validation function:

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

    or (for HTML form)

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

    You could add this code 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 errors output) in the validation function, this notification message can be added to this variable. If the function returns ‘true’, it means that you have entered captcha properly. In other cases the function will return ‘false’.

    Sincerely,
    BestWebSoft Support Team

    Hi,

    Since there is no reply from you, we consider this topic as resolved. We hope you’ve found the solution. If you have any questions, please feel free to contact us via our Help Center – http://support.bestwebsoft.com/.

    Sincerely,
    BestWebSoft Support Team

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Captcha in footer.php’ is closed to new replies.