• I need to be able to add the code to make a captcha appear on my contact form pages. I can see from examples on my Comments pages WHERE it goes by viewing the source code for the page, but I can’t copy/paste the code from there. I also can’t figure out how to see ALL of the background code for a page when I go to EDIT the page and ADD the code. I can only see the ‘visual’ and ‘text’ versions of my page, and adding the code there does no good. All of your answers in the forum explain things in terms I don’t have the background knowledge to understand. HOW do I see and edit ALL of the background code for a page? I am using ‘big brother’ theme. Please use the simplest terms possible for someone who can learn, but has little experience!
    Thanks in advance for your patience with me! Basically, I want the captcha code seen here: https://ipdpl.org/ask-a-librarian/ on the lower, Comment section of the window to apply instead to the upper, email section of the page so that my primary user doesn’t get 500 spam messages a day!

Viewing 2 replies - 1 through 2 (of 2 total)
  • You judt cann’t take some code somewhete and use it elsewhere.

    Take a look at WPSpamShield anti-spam, it gives you a contactform with anti-spam

    Thread Starter amhicks00

    (@amhicks00)

    Okay. Thanks for the suggestion. I have downloaded it, but now WordPress is telling me that my php is terribly out of date, so I am talking to my hosting provider about updating that. I’ll see if this will work better. Just for clarification’s sake, though, the captcha plug in website gave me the following information about adding captcha code to a contact form.

    Here is what their website said about adding a captcha to a contact form.
    1. Install the Captcha plugin and activate it.
    2. Open the file with the form (where you would like to add captcha to).
    3. Find a place to insert the code for the captcha output.
    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( function_exists( ‘cptchpr_display_captcha_custom’ ) ) { echo “<input type=’hidden’ name=’cntctfrm_contact_action’ value=’true’ />”; echo cptchpr_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(); } if( function_exists( ‘cptchpr_display_captcha_custom’ ) ) { echo “<input type=’hidden’ name=’cntctfrm_contact_action’ value=’true’ />”; echo cptchpr_display_captcha_custom(); } ?>
    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 ) || ( function_exists( ‘cptchpr_check_custom_form’ ) && cptchpr_check_custom_form() !== true ) ) echo “Please complete the CAPTCHA.”;
    or
    <?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 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’.

    Based on the above, where was I supposed to do all of this? The captcha code appeared just fine on the Comment fields AND on my login page, but it did it automatically when I activated the plugin…

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Needs to edit .html’ is closed to new replies.