• Resolved dc50093

    (@dc50093)


    I’ve installed, and activated, the plugin and I’m trying to insert a captcha into a simple html form but it’s not showing up. My understanding is that I need to insert the following php lines into the html form to make it work:

    <?php if( function_exists( ‘cptch_display_captcha_custom’ ) ) { echo “<input type=’hidden’ name=’cntctfrm_contact_action’ value=’true’ />”; echo cptch_display_captcha_custom(); } ?>

    <?php if( function_exists( ‘cptch_check_custom_form’ ) && cptch_check_custom_form() !== true ) echo “Please complete the CAPTCHA.” ?>

    I inserted these two lines just above the submit button but the captcha is not showing up. Here is my code:

    `<form role=”form” id=”WebToLeadForm” action=”https://xxxx.com/index.php?entryPoint=WebToLeadCapture&#8221; method=”POST” name=”WebToLeadForm”>

    <div class=”form-group”>
    <label for=”first_name”>First Name</label>
    <input class=”form-control input-lg” id=”first_name” name=”first_name” type=”text”>
    </div>

    <div class=”form-group”>
    <label for=”last_name”>Last Name</label>
    <input class=”form-control input-lg” id=”last_name” name=”last_name” type=”text”>
    </div>

    <div class=”form-group”>
    <label for=“title”>Title</label>
    <input class=”form-control input-lg” id=“title” name=“title” type=”text”>
    </div>

    <div class=”form-group”>
    <label for=”company”>Company Name</label>
    <input class=”form-control input-lg” id=”account_name” name=”account_name” type=”text”>
    </div>

    <div class=”form-group”>
    <label for=”phone”>Phone Number</label>
    <input class=”form-control input-lg” id=”phone_work” name=”phone_work” type=”text”>
    </div>

    <div class=”form-group”>
    <label for=”email”>Email</label>
    <input class=”form-control input-lg” id=”email1″ name=”email1″ type=”email”>
    </div>

    <?php

    if( function_exists( ‘cptch_display_captcha_custom’ ) ) { echo
    “<input type=’hidden’ name=’cntctfrm_contact_action’ value=’true’
    />”; echo cptch_display_captcha_custom(); } ?>

    <?php if( function_exists(
    ‘cptch_check_custom_form’ ) && cptch_check_custom_form() !==
    true ) echo “Please complete the CAPTCHA.” ?>

    <button type=”submit” class=”btn btn-default”>Submit</button>

    </form>`

    https://www.ads-software.com/plugins/captcha/

Viewing 4 replies - 1 through 4 (of 4 total)
  • I added your code to a custom page template and it worked.

    Where is your code? In a page template, plugin file, or theme file?

    Hi dc50093,

    1) if you added line
    <?php if( function_exists( 'cptch_display_captcha_custom' ) ) { echo "<input type='hidden' name='cntctfrm_contact_action' value='true' />"; echo cptch_display_captcha_custom(); } ?>
    to the necessary file and the plugin is activated, Captcha will be displayed for sure (you have to check if you make changes in the correct file)
    2) line
    <?php if( function_exists( 'cptch_check_custom_form' ) && cptch_check_custom_form() !== true ) echo "Please complete the CAPTCHA." ?>
    serves to check the entered value, i.e. it must be located in the file, where the form data are checked (it may be either the same file with the code of the form or another one).

    Sincerely,
    BestWebSoft Support Team

    I have done the same as this but when I look at my page, everything after the <?php is displayed on my form, not a captcha…

    This what comes up on my form…

    if( function_exists( ‘cptch_display_captcha_custom’ ) ) { echo
    ” />“; echo cptch_display_captcha_custom(); } ?>

    ‘cptch_check_custom_form’ ) && cptch_check_custom_form() !==
    true ) echo “Please complete the CAPTCHA.” ?>

    Update from this…It was not all on one line (not that it should matter) but when I moved it onto one line, things changed a bit but were still unpredictable…

    “; echo cptch_display_captcha_custom(); } ?>

    That is all that showed up on my form.

    Now, I’m adding this on a “page” by editing it using the TEXT mode (not Visual)…am I doing something drastically wrong?

    Hi,

    This problem occurs due to the fact that the code must be inserted directly into the required post/page template code, and you added the code into the post/page editor.

    Sincerely,
    BestWebSoft Support Team

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Custom HTML Form CAPTCHA Not Displaying’ is closed to new replies.