Hi,
Captcha will only be displayed and working correctly if you are using standard registration, login and comments form pages. The case is, you are using a custom contact form on your website, hence, to add captcha to it, please follow the guide below:
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